]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-53912.rs
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
[rust.git] / src / test / ui / issue-53912.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2
3 // This test is the same code as in ui/symbol-names/issue-60925.rs but this checks that the
4 // reproduction compiles successfully and doesn't segfault, whereas that test just checks that the
5 // symbol mangling fix produces the correct result.
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         pub(crate) fn foo() {
17             for _ in 0..0 {
18                 for _ in &[::dummy()] {
19                     ::dummy();
20                     ::dummy();
21                     ::dummy();
22                 }
23             }
24         }
25     }
26
27     pub(crate) fn foo() {
28         Foo::foo();
29         Foo::foo();
30     }
31 }
32
33 pub fn foo() {
34     foo::foo();
35 }
36
37 fn main() {}