about summary refs log tree commit diff
path: root/tests/ui/symbol-names/issue-53912.rs
blob: ba28316b0bf0534749c3edb2448bfcab2dc2be9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//@ build-pass

// This test is the same code as in ui/symbol-names/issue-60925.rs but this checks that the
// reproduction compiles successfully and doesn't segfault, whereas that test just checks that the
// symbol mangling fix produces the correct result.

fn dummy() {}

mod llvm {
    pub(crate) struct Foo;
}
mod foo {
    pub(crate) struct Foo<T>(T);

    impl Foo<crate::llvm::Foo> {
        pub(crate) fn foo() {
            for _ in 0..0 {
                for _ in &[crate::dummy()] {
                    crate::dummy();
                    crate::dummy();
                    crate::dummy();
                }
            }
        }
    }

    pub(crate) fn foo() {
        Foo::foo();
        Foo::foo();
    }
}

pub fn foo() {
    foo::foo();
}

fn main() {}