mangling_v0: Add a test for mangling of foreign types

This commit is contained in:
Vadim Petrochenkov 2021-12-27 20:05:22 +08:00
parent 6a1f9e6fc7
commit 1b8daf8c58
2 changed files with 39 additions and 0 deletions

View 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() {}

View 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