2019-12-14 03:28:32 +00:00
|
|
|
//@ build-fail
|
2019-04-13 16:03:02 +00:00
|
|
|
//@ revisions: legacy v0
|
2021-10-21 12:57:14 +00:00
|
|
|
//@[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy
|
|
|
|
//@[v0]compile-flags: -C symbol-mangling-version=v0
|
2021-02-02 19:59:48 +00:00
|
|
|
//@[legacy]normalize-stderr-test: "h[\w]{16}E?\)" -> "<SYMBOL_HASH>)"
|
2019-04-13 16:03:02 +00:00
|
|
|
|
2020-11-23 03:54:31 +00:00
|
|
|
#![feature(auto_traits, rustc_attrs)]
|
2016-03-16 19:00:20 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
mod foo {
|
|
|
|
pub struct Foo { x: u32 }
|
|
|
|
|
|
|
|
impl Foo {
|
2019-05-29 20:58:55 +00:00
|
|
|
#[rustc_symbol_name]
|
2019-04-13 16:03:02 +00:00
|
|
|
//[legacy]~^ ERROR symbol-name(_ZN5impl13foo3Foo3bar
|
|
|
|
//[legacy]~| ERROR demangling(impl1::foo::Foo::bar
|
|
|
|
//[legacy]~| ERROR demangling-alt(impl1::foo::Foo::bar)
|
2021-10-20 20:14:16 +00:00
|
|
|
//[v0]~^^^^ ERROR symbol-name(_RNvMNtCs
|
|
|
|
//[v0]~| ERROR demangling(<impl1[
|
2019-04-13 16:03:02 +00:00
|
|
|
//[v0]~| ERROR demangling-alt(<impl1::foo::Foo>::bar)
|
|
|
|
#[rustc_def_path]
|
|
|
|
//[legacy]~^ ERROR def-path(foo::Foo::bar)
|
|
|
|
//[v0]~^^ ERROR def-path(foo::Foo::bar)
|
2016-03-16 19:00:20 +00:00
|
|
|
fn bar() { }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod bar {
|
|
|
|
use foo::Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
2019-05-29 20:58:55 +00:00
|
|
|
#[rustc_symbol_name]
|
2019-04-13 16:03:02 +00:00
|
|
|
//[legacy]~^ ERROR symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz
|
|
|
|
//[legacy]~| ERROR demangling(impl1::bar::<impl impl1::foo::Foo>::baz
|
|
|
|
//[legacy]~| ERROR demangling-alt(impl1::bar::<impl impl1::foo::Foo>::baz)
|
2021-10-20 20:14:16 +00:00
|
|
|
//[v0]~^^^^ ERROR symbol-name(_RNvMNtCs
|
|
|
|
//[v0]~| ERROR demangling(<impl1[
|
2019-04-13 16:03:02 +00:00
|
|
|
//[v0]~| ERROR demangling-alt(<impl1::foo::Foo>::baz)
|
|
|
|
#[rustc_def_path]
|
|
|
|
//[legacy]~^ ERROR def-path(bar::<impl foo::Foo>::baz)
|
|
|
|
//[v0]~^^ ERROR def-path(bar::<impl foo::Foo>::baz)
|
2016-03-16 19:00:20 +00:00
|
|
|
fn baz() { }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-30 00:56:45 +00:00
|
|
|
trait Foo {
|
|
|
|
type Assoc;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto trait AutoTrait {}
|
|
|
|
|
2016-03-16 19:00:20 +00:00
|
|
|
fn main() {
|
2019-05-30 00:56:45 +00:00
|
|
|
// Test closure mangling, and disambiguators.
|
|
|
|
|| {};
|
|
|
|
|| {
|
|
|
|
trait Bar {
|
|
|
|
fn method(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test type mangling, by putting them in an `impl` header.
|
2020-09-01 21:28:11 +00:00
|
|
|
impl Bar for [&'_ (dyn Foo<Assoc = extern "C" fn(&u8, ...)> + AutoTrait); 3] {
|
2019-05-30 00:56:45 +00:00
|
|
|
#[rustc_symbol_name]
|
2020-01-11 02:22:36 +00:00
|
|
|
//[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
|
|
|
|
//[legacy]~| ERROR demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method
|
|
|
|
//[legacy]~| ERROR demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method)
|
2021-10-20 20:14:16 +00:00
|
|
|
//[v0]~^^^^ ERROR symbol-name(_RNvXNCNvCs
|
|
|
|
//[v0]~| ERROR demangling(<[&dyn
|
2019-08-10 11:38:17 +00:00
|
|
|
//[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)
|
2019-05-30 00:56:45 +00:00
|
|
|
#[rustc_def_path]
|
2022-09-21 15:57:30 +00:00
|
|
|
//[legacy]~^ ERROR def-path(<[&dyn Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
|
|
|
|
//[v0]~^^ ERROR def-path(<[&dyn Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
|
2019-05-30 00:56:45 +00:00
|
|
|
fn method(&self) {}
|
|
|
|
}
|
|
|
|
};
|
2016-03-16 19:00:20 +00:00
|
|
|
}
|