Skip to content

Commit 14cd80d

Browse files
committed
mangling_v0: Add a test for mangling of foreign types
1 parent 65f7fbc commit 14cd80d

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// build-fail
2+
// compile-flags: -Z symbol-mangling-version=v0
3+
4+
#![feature(extern_types)]
5+
#![feature(rustc_attrs)]
6+
7+
extern "C" {
8+
type ForeignType;
9+
}
10+
11+
struct Check<T: ?Sized>(T);
12+
13+
#[rustc_symbol_name]
14+
//~^ ERROR symbol-name(_RMCs
15+
//~| ERROR demangling(<foreign_types[
16+
//~| ERROR demangling-alt(<foreign_types::Check<foreign_types::ForeignType>>)
17+
impl Check<ForeignType> {}
18+
19+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: symbol-name(_RMCsCRATE_HASH_13foreign_typesINtB<REF>_5CheckNvNtB<REF>_011ForeignTypeE)
2+
--> $DIR/foreign-types.rs:13:1
3+
|
4+
LL | #[rustc_symbol_name]
5+
| ^^^^^^^^^^^^^^^^^^^^
6+
7+
error: demangling(<foreign_types[HASH]::Check<foreign_types[HASH]::ForeignType>>)
8+
--> $DIR/foreign-types.rs:13:1
9+
|
10+
LL | #[rustc_symbol_name]
11+
| ^^^^^^^^^^^^^^^^^^^^
12+
13+
error: demangling-alt(<foreign_types::Check<foreign_types::ForeignType>>)
14+
--> $DIR/foreign-types.rs:13:1
15+
|
16+
LL | #[rustc_symbol_name]
17+
| ^^^^^^^^^^^^^^^^^^^^
18+
19+
error: aborting due to 3 previous errors
20+

0 commit comments

Comments
 (0)