mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Add glob import to redundancy test
This commit is contained in:
parent
0f3b1c0358
commit
4a619aa126
@ -11,8 +11,17 @@ fn baz() -> Bar {
|
||||
3
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
use m1::S; //~ WARNING redundant import
|
||||
let _s = S {};
|
||||
}
|
||||
|
@ -1,11 +1,8 @@
|
||||
warning: the item `Bar` is imported redundantly
|
||||
--> $DIR/use-redundant.rs:15:9
|
||||
warning: unused import: `m1::*`
|
||||
--> $DIR/use-redundant.rs:17:5
|
||||
|
|
||||
LL | use crate::foo::Bar;
|
||||
| --------------- the item `Bar` was already imported here
|
||||
...
|
||||
LL | use crate::foo::Bar;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
LL | use m1::*;
|
||||
| ^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/use-redundant.rs:2:9
|
||||
@ -13,3 +10,27 @@ note: lint level defined here
|
||||
LL | #![warn(unused_imports)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `m2::*`
|
||||
--> $DIR/use-redundant.rs:18:5
|
||||
|
|
||||
LL | use m2::*;
|
||||
| ^^^^^
|
||||
|
||||
warning: the item `Bar` is imported redundantly
|
||||
--> $DIR/use-redundant.rs:21:9
|
||||
|
|
||||
LL | use crate::foo::Bar;
|
||||
| --------------- the item `Bar` was already imported here
|
||||
...
|
||||
LL | use crate::foo::Bar;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
warning: the item `S` is imported redundantly
|
||||
--> $DIR/use-redundant.rs:25:9
|
||||
|
|
||||
LL | use m1::*;
|
||||
| ----- the item `S` was already imported here
|
||||
...
|
||||
LL | use m1::S;
|
||||
| ^^^^^
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user