rust/tests/ui/lint/use-redundant/use-redundant-not-parent.rs
Michael Howell 000e94e67d diagnostics: account for glob shadowing when linting redundant imports
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-04-01 11:11:21 -07:00

20 lines
282 B
Rust

// check-pass
pub mod bar {
pub struct Foo(pub Bar);
pub struct Bar(pub char);
}
pub mod x {
pub struct Foo(pub crate::bar::Bar);
}
pub fn warning() -> x::Foo {
use bar::*;
#[deny(unused_imports)]
use x::Foo; // no error
Foo(Bar('a'))
}
fn main() {}