]> git.lizzy.rs Git - rust.git/blob - src/test/ui/symbol-names/issue-60925.rs
Rollup merge of #61263 - GuillaumeGomez:valid-html, r=Manishearth
[rust.git] / src / test / ui / symbol-names / issue-60925.rs
1 // ignore-tidy-linelength
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
12 fn dummy() {}
13
14 mod llvm {
15     pub(crate) struct Foo;
16 }
17 mod foo {
18     pub(crate) struct Foo<T>(T);
19
20     impl Foo<::llvm::Foo> {
21         #[rustc_symbol_name]
22         //[legacy]~^ ERROR symbol-name(_ZN11issue_609253foo36Foo$LT$issue_60925..llv$6d$..Foo$GT$3foo
23         //[legacy]~| ERROR demangling(issue_60925::foo::Foo<issue_60925::llv$6d$..Foo$GT$::foo
24         //[legacy]~| ERROR demangling-alt(issue_60925::foo::Foo<issue_60925::llv$6d$..Foo$GT$::foo)
25          //[v0]~^^^^ ERROR symbol-name(_RNvMNtCs4fqI2P2rA04_11issue_609253fooINtB2_3FooNtNtB4_4llvm3FooE3foo)
26             //[v0]~| ERROR demangling(<issue_60925[317d481089b8c8fe]::foo::Foo<issue_60925[317d481089b8c8fe]::llvm::Foo>>::foo)
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
45 pub fn foo() {
46     foo::foo();
47 }
48
49 fn main() {}