]> git.lizzy.rs Git - rust.git/blob - src/test/ui/symbol-names/issue-60925.rs
rustc_codegen_utils: test demangler output, not just symbol names.
[rust.git] / src / test / ui / symbol-names / issue-60925.rs
1 #![feature(rustc_attrs)]
2
3 // This test is the same code as in ui/issue-53912.rs but this test checks that the symbol mangling
4 // fix produces the correct result, whereas that test just checks that the reproduction compiles
5 // successfully and doesn't segfault
6
7 fn dummy() {}
8
9 mod llvm {
10     pub(crate) struct Foo;
11 }
12 mod foo {
13     pub(crate) struct Foo<T>(T);
14
15     impl Foo<::llvm::Foo> {
16         #[rustc_symbol_name]
17         //~^ ERROR symbol-name(_ZN11issue_609253foo36Foo$LT$issue_60925..llv$6d$..Foo$GT$3foo
18         //~| ERROR demangling(issue_60925::foo::Foo<issue_60925::llv$6d$..Foo$GT$::foo
19         //~| ERROR demangling-alt(issue_60925::foo::Foo<issue_60925::llv$6d$..Foo$GT$::foo)
20         pub(crate) fn foo() {
21             for _ in 0..0 {
22                 for _ in &[::dummy()] {
23                     ::dummy();
24                     ::dummy();
25                     ::dummy();
26                 }
27             }
28         }
29     }
30
31     pub(crate) fn foo() {
32         Foo::foo();
33         Foo::foo();
34     }
35 }
36
37 pub fn foo() {
38     foo::foo();
39 }
40
41 fn main() {}