File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ mod bar {
66
66
67
67
fn g ( ) {
68
68
use self :: g; //~ ERROR unused import: `self::g`
69
+ //~^ ERROR the item `g` is imported redundantly
69
70
fn f ( ) {
70
71
self :: g ( ) ;
71
72
}
@@ -75,6 +76,7 @@ fn g() {
75
76
#[ allow( unused_variables) ]
76
77
fn h ( ) {
77
78
use test2:: foo; //~ ERROR unused import: `test2::foo`
79
+ //~^ ERROR the item `foo` is imported redundantly
78
80
let foo = 0 ;
79
81
}
80
82
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ error: the item `g` is imported redundantly
40
40
LL | / fn g() {
41
41
LL | | use self::g;
42
42
| | ^^^^^^^
43
+ LL | |
43
44
LL | | fn f() {
44
45
LL | | self::g();
45
46
LL | | }
@@ -53,7 +54,7 @@ LL | use self::g;
53
54
| ^^^^^^^
54
55
55
56
error: the item `foo` is imported redundantly
56
- --> $DIR/lint-unused-imports.rs:77 :9
57
+ --> $DIR/lint-unused-imports.rs:78 :9
57
58
|
58
59
LL | use test2::{foo, bar};
59
60
| --- the item `foo` was already imported here
@@ -62,7 +63,7 @@ LL | use test2::foo;
62
63
| ^^^^^^^^^^
63
64
64
65
error: unused import: `test2::foo`
65
- --> $DIR/lint-unused-imports.rs:77 :9
66
+ --> $DIR/lint-unused-imports.rs:78 :9
66
67
|
67
68
LL | use test2::foo;
68
69
| ^^^^^^^^^^
Original file line number Diff line number Diff line change 1
1
// compile-pass
2
+ #![ warn( unused_imports) ]
2
3
3
4
use crate :: foo:: Bar ; //~ WARNING first import
4
5
Original file line number Diff line number Diff line change 1
1
warning: the item `Bar` is imported redundantly
2
- --> $DIR/use-redundant.rs:14 :9
2
+ --> $DIR/use-redundant.rs:15 :9
3
3
|
4
4
LL | use crate::foo::Bar;
5
- | --------------- the item `Bar` was imported here
5
+ | --------------- the item `Bar` was already imported here
6
6
...
7
7
LL | use crate::foo::Bar;
8
8
| ^^^^^^^^^^^^^^^
9
9
|
10
- = note: #[warn(redundant_import)] on by default
10
+ note: lint level defined here
11
+ --> $DIR/use-redundant.rs:2:9
12
+ |
13
+ LL | #![warn(unused_imports)]
14
+ | ^^^^^^^^^^^^^^
11
15
You can’t perform that action at this time.
0 commit comments