2 // ignore-tidy-linelength
3 // revisions: legacy v0
4 //[legacy]compile-flags: -Z symbol-mangling-version=legacy
5 //[v0]compile-flags: -Z symbol-mangling-version=v0
6 //[legacy]normalize-stderr-32bit: "hee444285569b39c2" -> "SYMBOL_HASH"
7 //[legacy]normalize-stderr-64bit: "h310ea0259fc3d32d" -> "SYMBOL_HASH"
9 #![feature(optin_builtin_traits, rustc_attrs)]
13 pub struct Foo { x: u32 }
17 //[legacy]~^ ERROR symbol-name(_ZN5impl13foo3Foo3bar
18 //[legacy]~| ERROR demangling(impl1::foo::Foo::bar
19 //[legacy]~| ERROR demangling-alt(impl1::foo::Foo::bar)
20 //[v0]~^^^^ ERROR symbol-name(_RNvMNtCs4fqI2P2rA04_5impl13fooNtB2_3Foo3bar)
21 //[v0]~| ERROR demangling(<impl1[317d481089b8c8fe]::foo::Foo>::bar)
22 //[v0]~| ERROR demangling-alt(<impl1::foo::Foo>::bar)
24 //[legacy]~^ ERROR def-path(foo::Foo::bar)
25 //[v0]~^^ ERROR def-path(foo::Foo::bar)
35 //[legacy]~^ ERROR symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz
36 //[legacy]~| ERROR demangling(impl1::bar::<impl impl1::foo::Foo>::baz
37 //[legacy]~| ERROR demangling-alt(impl1::bar::<impl impl1::foo::Foo>::baz)
38 //[v0]~^^^^ ERROR symbol-name(_RNvMNtCs4fqI2P2rA04_5impl13barNtNtB4_3foo3Foo3baz)
39 //[v0]~| ERROR demangling(<impl1[317d481089b8c8fe]::foo::Foo>::baz)
40 //[v0]~| ERROR demangling-alt(<impl1::foo::Foo>::baz)
42 //[legacy]~^ ERROR def-path(bar::<impl foo::Foo>::baz)
43 //[v0]~^^ ERROR def-path(bar::<impl foo::Foo>::baz)
52 auto trait AutoTrait {}
55 // Test closure mangling, and disambiguators.
62 // Test type mangling, by putting them in an `impl` header.
63 impl Bar for [&'_ (dyn Foo<Assoc = extern fn(&u8, ...)> + AutoTrait); 3] {
65 //[legacy]~^ ERROR symbol-name(_ZN209_$LT$$u5b$$RF$dyn$u20$impl1..Foo$u2b$Assoc$u20$$u3d$$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RF$u8$C$$u20$...$RP$$u2b$impl1..AutoTrait$u3b$$u20$3$u5d$$u20$as$u20$impl1..main..$u7b$$u7b$closure$u7d$$u7d$..Bar$GT$6method
66 //[legacy]~| ERROR demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method
67 //[legacy]~| ERROR demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method)
68 //[v0]~^^^^ ERROR symbol-name(_RNvXNCNvCs4fqI2P2rA04_5impl14mains_0ARDNtB6_3Foop5AssocFG_KCRL0_hvEuNtB6_9AutoTraitEL_j3_NtB2_3Bar6method)
69 //[v0]~| ERROR demangling(<[&dyn impl1[317d481089b8c8fe]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[317d481089b8c8fe]::AutoTrait; 3: usize] as impl1[317d481089b8c8fe]::main::{closure#1}::Bar>::method)
70 //[v0]~| ERROR demangling-alt(<[&dyn impl1::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method)
72 //[legacy]~^ ERROR def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{{closure}}#1::Bar>::method)
73 //[v0]~^^ ERROR def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{{closure}}#1::Bar>::method)