File tree Expand file tree Collapse file tree 2 files changed +36
-6
lines changed Expand file tree Collapse file tree 2 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,17 @@ fn baz() -> Bar {
11
11
3
12
12
}
13
13
14
+ mod m1 { pub struct S { } }
15
+ mod m2 { pub struct S { } }
16
+
17
+ use m1:: * ;
18
+ use m2:: * ;
19
+
14
20
fn main ( ) {
15
21
use crate :: foo:: Bar ; //~ WARNING redundant import
16
22
let _a: Bar = 3 ;
17
23
baz ( ) ;
24
+
25
+ use m1:: S ; //~ WARNING redundant import
26
+ let _s = S { } ;
18
27
}
Original file line number Diff line number Diff line change
1
+ warning: unused import: `m1::*`
2
+ --> $DIR/use-redundant.rs:17:5
3
+ |
4
+ LL | use m1::*;
5
+ | ^^^^^
6
+ |
7
+ note: lint level defined here
8
+ --> $DIR/use-redundant.rs:2:9
9
+ |
10
+ LL | #![warn(unused_imports)]
11
+ | ^^^^^^^^^^^^^^
12
+
13
+ warning: unused import: `m2::*`
14
+ --> $DIR/use-redundant.rs:18:5
15
+ |
16
+ LL | use m2::*;
17
+ | ^^^^^
18
+
1
19
warning: the item `Bar` is imported redundantly
2
- --> $DIR/use-redundant.rs:15 :9
20
+ --> $DIR/use-redundant.rs:21 :9
3
21
|
4
22
LL | use crate::foo::Bar;
5
23
| --------------- the item `Bar` was already imported here
6
24
...
7
25
LL | use crate::foo::Bar;
8
26
| ^^^^^^^^^^^^^^^
27
+
28
+ warning: the item `S` is imported redundantly
29
+ --> $DIR/use-redundant.rs:25:9
9
30
|
10
- note: lint level defined here
11
- --> $DIR/use-redundant.rs:2:9
12
- |
13
- LL | #![warn(unused_imports)]
14
- | ^^^^^^^^^^^^^^
31
+ LL | use m1::*;
32
+ | ----- the item `S` was already imported here
33
+ ...
34
+ LL | use m1::S;
35
+ | ^^^^^
15
36
You can’t perform that action at this time.
0 commit comments