1
Fork 0
rust/src/test/ui/lint/use-redundant.rs

28 lines
395 B
Rust
Raw Normal View History

// compile-pass
2019-03-17 11:38:38 +01:00
#![warn(unused_imports)]
use crate::foo::Bar; //~ WARNING first import
mod foo {
pub type Bar = i32;
}
fn baz() -> Bar {
3
}
2019-03-17 11:55:32 +01:00
mod m1 { pub struct S {} }
mod m2 { pub struct S {} }
use m1::*;
use m2::*;
fn main() {
use crate::foo::Bar; //~ WARNING redundant import
let _a: Bar = 3;
baz();
2019-03-17 11:55:32 +01:00
use m1::S; //~ WARNING redundant import
let _s = S {};
}