]> git.proxmox.com Git - rustc.git/blame - src/test/ui/symbol-names/issue-60925.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / symbol-names / issue-60925.rs
CommitLineData
dfeec247 1// build-fail
dc9dc135
XL
2// revisions: legacy v0
3//[legacy]compile-flags: -Z symbol-mangling-version=legacy
4 //[v0]compile-flags: -Z symbol-mangling-version=v0
5
6#![feature(rustc_attrs)]
7
8// This test is the same code as in ui/issue-53912.rs but this test checks that the symbol mangling
9// fix produces the correct result, whereas that test just checks that the reproduction compiles
10// successfully and doesn't crash LLVM
11
12fn dummy() {}
13
14mod llvm {
15 pub(crate) struct Foo;
16}
17mod foo {
18 pub(crate) struct Foo<T>(T);
19
20 impl Foo<::llvm::Foo> {
21 #[rustc_symbol_name]
22 //[legacy]~^ ERROR symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo
e1599b0c
XL
23 //[legacy]~| ERROR demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo
24 //[legacy]~| ERROR demangling-alt(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo)
136023e0
XL
25 //[v0]~^^^^ ERROR symbol-name(_RNvMNtCs8dUWfuENynB_11issue_609253fooINtB2_3FooNtNtB4_4llvm3FooE3foo)
26 //[v0]~| ERROR demangling(<issue_60925[5fcbb46c6fac4139]::foo::Foo<issue_60925[5fcbb46c6fac4139]::llvm::Foo>>::foo)
dc9dc135
XL
27 //[v0]~| ERROR demangling-alt(<issue_60925::foo::Foo<issue_60925::llvm::Foo>>::foo)
28 pub(crate) fn foo() {
29 for _ in 0..0 {
30 for _ in &[::dummy()] {
31 ::dummy();
32 ::dummy();
33 ::dummy();
34 }
35 }
36 }
37 }
38
39 pub(crate) fn foo() {
40 Foo::foo();
41 Foo::foo();
42 }
43}
44
45pub fn foo() {
46 foo::foo();
47}
48
49fn main() {}