diff options
| author | Fabian Drinck <fabian.drinck@rwth-aachen.de> | 2019-03-17 11:38:38 +0100 |
|---|---|---|
| committer | Fabian Drinck <fabian.drinck@rwth-aachen.de> | 2019-03-30 22:37:02 +0100 |
| commit | 0f3b1c035837fc5e101d5a2d8c49b1d5128927b5 (patch) | |
| tree | dd2ff007bb6af563e7f558ab159a1559a12b1302 | |
| parent | 6e7b45e12b76cad70262281d5fae7ad98032fafc (diff) | |
| download | rust-0f3b1c035837fc5e101d5a2d8c49b1d5128927b5.tar.gz rust-0f3b1c035837fc5e101d5a2d8c49b1d5128927b5.zip | |
Fix tests
| -rw-r--r-- | src/test/ui/lint/lint-unused-imports.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/lint-unused-imports.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/lint/use-redundant.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/lint/use-redundant.stderr | 10 |
4 files changed, 13 insertions, 5 deletions
diff --git a/src/test/ui/lint/lint-unused-imports.rs b/src/test/ui/lint/lint-unused-imports.rs index 9c5b206203c..4754d888076 100644 --- a/src/test/ui/lint/lint-unused-imports.rs +++ b/src/test/ui/lint/lint-unused-imports.rs @@ -66,6 +66,7 @@ mod bar { fn g() { use self::g; //~ ERROR unused import: `self::g` + //~^ ERROR the item `g` is imported redundantly fn f() { self::g(); } @@ -75,6 +76,7 @@ fn g() { #[allow(unused_variables)] fn h() { use test2::foo; //~ ERROR unused import: `test2::foo` + //~^ ERROR the item `foo` is imported redundantly let foo = 0; } diff --git a/src/test/ui/lint/lint-unused-imports.stderr b/src/test/ui/lint/lint-unused-imports.stderr index 62490972420..b37f25ec017 100644 --- a/src/test/ui/lint/lint-unused-imports.stderr +++ b/src/test/ui/lint/lint-unused-imports.stderr @@ -40,6 +40,7 @@ error: the item `g` is imported redundantly LL | / fn g() { LL | | use self::g; | | ^^^^^^^ +LL | | LL | | fn f() { LL | | self::g(); LL | | } @@ -53,7 +54,7 @@ LL | use self::g; | ^^^^^^^ error: the item `foo` is imported redundantly - --> $DIR/lint-unused-imports.rs:77:9 + --> $DIR/lint-unused-imports.rs:78:9 | LL | use test2::{foo, bar}; | --- the item `foo` was already imported here @@ -62,7 +63,7 @@ LL | use test2::foo; | ^^^^^^^^^^ error: unused import: `test2::foo` - --> $DIR/lint-unused-imports.rs:77:9 + --> $DIR/lint-unused-imports.rs:78:9 | LL | use test2::foo; | ^^^^^^^^^^ diff --git a/src/test/ui/lint/use-redundant.rs b/src/test/ui/lint/use-redundant.rs index 50d4d30625a..7abf5e498b5 100644 --- a/src/test/ui/lint/use-redundant.rs +++ b/src/test/ui/lint/use-redundant.rs @@ -1,4 +1,5 @@ // compile-pass +#![warn(unused_imports)] use crate::foo::Bar; //~ WARNING first import diff --git a/src/test/ui/lint/use-redundant.stderr b/src/test/ui/lint/use-redundant.stderr index b5000b22a1d..b25ffc6073f 100644 --- a/src/test/ui/lint/use-redundant.stderr +++ b/src/test/ui/lint/use-redundant.stderr @@ -1,11 +1,15 @@ warning: the item `Bar` is imported redundantly - --> $DIR/use-redundant.rs:14:9 + --> $DIR/use-redundant.rs:15:9 | LL | use crate::foo::Bar; - | --------------- the item `Bar` was imported here + | --------------- the item `Bar` was already imported here ... LL | use crate::foo::Bar; | ^^^^^^^^^^^^^^^ | - = note: #[warn(redundant_import)] on by default +note: lint level defined here + --> $DIR/use-redundant.rs:2:9 + | +LL | #![warn(unused_imports)] + | ^^^^^^^^^^^^^^ |
