File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,35 @@ error: unused import: `foo::Square`
34
34
LL | use foo::Square;
35
35
| ^^^^^^^^^^^
36
36
37
+ warning: the item `g` is imported redundantly
38
+ --> $DIR/lint-unused-imports.rs:68:9
39
+ |
40
+ LL | / fn g() {
41
+ LL | | use self::g;
42
+ | | ^^^^^^^
43
+ LL | | fn f() {
44
+ LL | | self::g();
45
+ LL | | }
46
+ LL | | }
47
+ | |_- the item `g` was already imported here
48
+ |
49
+ = note: #[warn(redundant_import)] on by default
50
+
37
51
error: unused import: `self::g`
38
52
--> $DIR/lint-unused-imports.rs:68:9
39
53
|
40
54
LL | use self::g;
41
55
| ^^^^^^^
42
56
57
+ warning: the item `foo` is imported redundantly
58
+ --> $DIR/lint-unused-imports.rs:77:9
59
+ |
60
+ LL | use test2::{foo, bar};
61
+ | --- the item `foo` was already imported here
62
+ ...
63
+ LL | use test2::foo;
64
+ | ^^^^^^^^^^
65
+
43
66
error: unused import: `test2::foo`
44
67
--> $DIR/lint-unused-imports.rs:77:9
45
68
|
Original file line number Diff line number Diff line change @@ -52,5 +52,51 @@ error: imports cannot refer to local variables
52
52
LL | use {T as _, x};
53
53
| ^
54
54
55
+ warning: the item `T` is imported redundantly
56
+ --> $DIR/future-proofing-locals.rs:19:9
57
+ |
58
+ LL | / mod T {
59
+ LL | | pub struct U;
60
+ LL | | }
61
+ | |_- the item `T` was already imported here
62
+ ...
63
+ LL | use T;
64
+ | ^
65
+ |
66
+ = note: #[warn(redundant_import)] on by default
67
+
68
+ warning: the item `x` is imported redundantly
69
+ --> $DIR/future-proofing-locals.rs:31:9
70
+ |
71
+ LL | / mod x {
72
+ LL | | pub struct y;
73
+ LL | | }
74
+ | |_- the item `x` was already imported here
75
+ ...
76
+ LL | use x;
77
+ | ^
78
+
79
+ warning: the item `x` is imported redundantly
80
+ --> $DIR/future-proofing-locals.rs:37:17
81
+ |
82
+ LL | / mod x {
83
+ LL | | pub struct y;
84
+ LL | | }
85
+ | |_- the item `x` was already imported here
86
+ ...
87
+ LL | use x;
88
+ | ^
89
+
90
+ warning: the item `x` is imported redundantly
91
+ --> $DIR/future-proofing-locals.rs:45:18
92
+ |
93
+ LL | / mod x {
94
+ LL | | pub struct y;
95
+ LL | | }
96
+ | |_- the item `x` was already imported here
97
+ ...
98
+ LL | use {T as _, x};
99
+ | ^
100
+
55
101
error: aborting due to 9 previous errors
56
102
You can’t perform that action at this time.
0 commit comments