mangling_v0: Add a test for mangling of foreign types
This commit is contained in:
parent
6a1f9e6fc7
commit
1b8daf8c58
2 changed files with 39 additions and 0 deletions
19
src/test/ui/symbol-names/foreign-types.rs
Normal file
19
src/test/ui/symbol-names/foreign-types.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// build-fail
|
||||
// compile-flags: -Z symbol-mangling-version=v0
|
||||
|
||||
#![feature(extern_types)]
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
extern "C" {
|
||||
type ForeignType;
|
||||
}
|
||||
|
||||
struct Check<T: ?Sized>(T);
|
||||
|
||||
#[rustc_symbol_name]
|
||||
//~^ ERROR symbol-name(_RMCs
|
||||
//~| ERROR demangling(<foreign_types[
|
||||
//~| ERROR demangling-alt(<foreign_types::Check<foreign_types::ForeignType>>)
|
||||
impl Check<ForeignType> {}
|
||||
|
||||
fn main() {}
|
||||
20
src/test/ui/symbol-names/foreign-types.stderr
Normal file
20
src/test/ui/symbol-names/foreign-types.stderr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
error: symbol-name(_RMCsCRATE_HASH_13foreign_typesINtB<REF>_5CheckNvNtB<REF>_011ForeignTypeE)
|
||||
--> $DIR/foreign-types.rs:13:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling(<foreign_types[HASH]::Check<foreign_types[HASH]::ForeignType>>)
|
||||
--> $DIR/foreign-types.rs:13:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling-alt(<foreign_types::Check<foreign_types::ForeignType>>)
|
||||
--> $DIR/foreign-types.rs:13:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue