]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/issue-88472.rs
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / resolve / issue-88472.rs
1 // Regression test for #88472, where a suggestion was issued to
2 // import an inaccessible struct.
3
4 #![warn(unused_imports)]
5 //~^ NOTE: the lint level is defined here
6
7 mod a {
8     struct Foo;
9     //~^ NOTE: struct `a::Foo` exists but is inaccessible
10     //~| NOTE: not accessible
11 }
12
13 mod b {
14     use crate::a::*;
15     //~^ WARNING: unused import
16     type Bar = Foo;
17     //~^ ERROR: cannot find type `Foo` in this scope [E0412]
18     //~| NOTE: not found in this scope
19 }
20
21 mod c {
22     enum Eee {}
23     //~^ NOTE: these enums exist but are inaccessible
24     //~| NOTE: `c::Eee`: not accessible
25
26     mod d {
27         enum Eee {}
28         //~^ NOTE: `c::d::Eee`: not accessible
29     }
30 }
31
32 mod e {
33     type Baz = Eee;
34     //~^ ERROR: cannot find type `Eee` in this scope [E0412]
35     //~| NOTE: not found in this scope
36 }
37
38 fn main() {}