diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-10-26 23:49:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-26 23:49:27 +0200 |
| commit | cf6f885e75a642de873786bf5fc434bb2bef6b96 (patch) | |
| tree | b7e3f6885a7a46b1bcf61537a823823057603d5a /src/test | |
| parent | 12eefac766f0955625d84a38788e10a70bf09497 (diff) | |
| parent | 2bd94188f79b3aed99f148d05ce300621ad41209 (diff) | |
| download | rust-cf6f885e75a642de873786bf5fc434bb2bef6b96.tar.gz rust-cf6f885e75a642de873786bf5fc434bb2bef6b96.zip | |
Rollup merge of #37394 - cramertj:cramertj/unused-import-with-id, r=GuillaumeGomez
Add identifier to unused import warnings Fix #37376. For some reason, though, I'm getting warnings with messages like "76:9: 76:16: unused import: `self::g`" instead of "unused import: `self::g`". @pnkfelix Any ideas what might be causing this?
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/lint-unused-imports.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs index 239f380e6c4..3f91c3e1e5c 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/compile-fail/lint-unused-imports.rs @@ -17,19 +17,19 @@ use std::mem::*; // shouldn't get errors for not using // everything imported // Should get errors for both 'Some' and 'None' -use std::option::Option::{Some, None}; //~ ERROR unused import - //~^ ERROR unused import +use std::option::Option::{Some, None}; //~ ERROR unused import: `Some` + //~^ ERROR unused import: `None` -use test::A; //~ ERROR unused import +use test::A; //~ ERROR unused import: `test::A` // Be sure that if we just bring some methods into scope that they're also // counted as being used. use test::B; // But only when actually used: do not get confused by the method with the same name. -use test::B2; //~ ERROR unused import +use test::B2; //~ ERROR unused import: `test::B2` // Make sure this import is warned about when at least one of its imported names // is unused -use test2::{foo, bar}; //~ ERROR unused import +use test2::{foo, bar}; //~ ERROR unused import: `bar` mod test2 { pub fn foo() {} @@ -57,7 +57,7 @@ mod bar { pub mod c { use foo::Point; - use foo::Square; //~ ERROR unused import + use foo::Square; //~ ERROR unused import: `foo::Square` pub fn cc(_p: Point) -> super::Square { fn f() -> super::Square { super::Square @@ -73,7 +73,7 @@ mod bar { } fn g() { - use self::g; //~ ERROR unused import + use self::g; //~ ERROR unused import: `self::g` fn f() { self::g(); } @@ -82,7 +82,7 @@ fn g() { // c.f. issue #35135 #[allow(unused_variables)] fn h() { - use test2::foo; //~ ERROR unused import + use test2::foo; //~ ERROR unused import: `test2::foo` let foo = 0; } |
