rust/tests/ui/lint/use-redundant.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
395 B
Rust
Raw Normal View History

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