Skip to content

Commit aac7295

Browse files
Fix tests
1 parent bbbc446 commit aac7295

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/test/ui/lint/lint-unused-imports.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ mod bar {
6666

6767
fn g() {
6868
use self::g; //~ ERROR unused import: `self::g`
69+
//~^ ERROR the item `g` is imported redundantly
6970
fn f() {
7071
self::g();
7172
}
@@ -75,6 +76,7 @@ fn g() {
7576
#[allow(unused_variables)]
7677
fn h() {
7778
use test2::foo; //~ ERROR unused import: `test2::foo`
79+
//~^ ERROR the item `foo` is imported redundantly
7880
let foo = 0;
7981
}
8082

src/test/ui/lint/lint-unused-imports.stderr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ error: the item `g` is imported redundantly
4040
LL | / fn g() {
4141
LL | | use self::g;
4242
| | ^^^^^^^
43+
LL | |
4344
LL | | fn f() {
4445
LL | | self::g();
4546
LL | | }
@@ -53,7 +54,7 @@ LL | use self::g;
5354
| ^^^^^^^
5455

5556
error: the item `foo` is imported redundantly
56-
--> $DIR/lint-unused-imports.rs:77:9
57+
--> $DIR/lint-unused-imports.rs:78:9
5758
|
5859
LL | use test2::{foo, bar};
5960
| --- the item `foo` was already imported here
@@ -62,7 +63,7 @@ LL | use test2::foo;
6263
| ^^^^^^^^^^
6364

6465
error: unused import: `test2::foo`
65-
--> $DIR/lint-unused-imports.rs:77:9
66+
--> $DIR/lint-unused-imports.rs:78:9
6667
|
6768
LL | use test2::foo;
6869
| ^^^^^^^^^^

src/test/ui/lint/use-redundant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// compile-pass
2+
#![warn(unused_imports)]
23

34
use crate::foo::Bar; //~ WARNING first import
45

src/test/ui/lint/use-redundant.stderr

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
warning: the item `Bar` is imported redundantly
2-
--> $DIR/use-redundant.rs:14:9
2+
--> $DIR/use-redundant.rs:15:9
33
|
44
LL | use crate::foo::Bar;
5-
| --------------- the item `Bar` was imported here
5+
| --------------- the item `Bar` was already imported here
66
...
77
LL | use crate::foo::Bar;
88
| ^^^^^^^^^^^^^^^
99
|
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+
| ^^^^^^^^^^^^^^
1115

0 commit comments

Comments
 (0)