rust/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.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

22 lines
348 B
Rust

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