2021-09-10 18:15:40 -05:00
|
|
|
// Regression test for #88472, where a suggestion was issued to
|
|
|
|
// import an inaccessible struct.
|
|
|
|
|
|
|
|
#![warn(unused_imports)]
|
|
|
|
//~^ NOTE: the lint level is defined here
|
|
|
|
|
|
|
|
mod a {
|
|
|
|
struct Foo;
|
2021-09-17 17:07:41 -05:00
|
|
|
//~^ NOTE: struct `a::Foo` exists but is inaccessible
|
|
|
|
//~| NOTE: not accessible
|
2021-09-10 18:15:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
mod b {
|
|
|
|
use crate::a::*;
|
|
|
|
//~^ WARNING: unused import
|
|
|
|
type Bar = Foo;
|
|
|
|
//~^ ERROR: cannot find type `Foo` in this scope [E0412]
|
|
|
|
//~| NOTE: not found in this scope
|
|
|
|
}
|
|
|
|
|
|
|
|
mod c {
|
|
|
|
enum Eee {}
|
2021-09-17 17:07:41 -05:00
|
|
|
//~^ NOTE: these enums exist but are inaccessible
|
|
|
|
//~| NOTE: `c::Eee`: not accessible
|
2021-09-10 18:15:40 -05:00
|
|
|
|
|
|
|
mod d {
|
|
|
|
enum Eee {}
|
2021-09-17 17:07:41 -05:00
|
|
|
//~^ NOTE: `c::d::Eee`: not accessible
|
2021-09-10 18:15:40 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod e {
|
|
|
|
type Baz = Eee;
|
|
|
|
//~^ ERROR: cannot find type `Eee` in this scope [E0412]
|
|
|
|
//~| NOTE: not found in this scope
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|