]> git.lizzy.rs Git - rust.git/blob - src/test/ui/symbol-names/issue-60925.rs
Rollup merge of #61195 - davidtwco:seg-fault-mangler, r=eddyb
[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 _ZN11issue_609253foo36Foo$LT$issue_60925..llv$6d$..Foo$GT$3foo17h059a991a004536adE
18         pub(crate) fn foo() {
19             for _ in 0..0 {
20                 for _ in &[::dummy()] {
21                     ::dummy();
22                     ::dummy();
23                     ::dummy();
24                 }
25             }
26         }
27     }
28
29     pub(crate) fn foo() {
30         Foo::foo();
31         Foo::foo();
32     }
33 }
34
35 pub fn foo() {
36     foo::foo();
37 }
38
39 fn main() {}