forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#47726 - pietroalbini:fix-nested-empty-group…
…s-span, r=petrochenkov Fix spans in unused import lint for nested groups This fixes an inconsistency for empty nested groups, and adds a test for all the possible cases of the lint. ``` warning: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*` --> test.rs:16:11 | 16 | use foo::{Foo, bar::{baz::{}, foobar::*}, *}; | ^^^ ^^^^^^^ ^^^^^^^^^ ^ | = note: #[warn(unused_imports)] on by default warning: unused import: `*` --> test.rs:17:24 | 17 | use foo::bar::baz::{*, *}; | ^ warning: unused import: `use foo::{};` --> test.rs:18:1 | 18 | use foo::{}; | ^^^^^^^^^^^^ ``` cc rust-lang#44494
- Loading branch information
Showing
4 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/test/ui/owl-import-generates-unused-import-lint.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*` | ||
--> $DIR/use-nested-groups-unused-imports.rs:26:11 | ||
| | ||
26 | use foo::{Foo, bar::{baz::{}, foobar::*}, *}; | ||
| ^^^ ^^^^^^^ ^^^^^^^^^ ^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/use-nested-groups-unused-imports.rs:13:9 | ||
| | ||
13 | #![deny(unused_imports)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: unused import: `*` | ||
--> $DIR/use-nested-groups-unused-imports.rs:28:24 | ||
| | ||
28 | use foo::bar::baz::{*, *}; | ||
| ^ | ||
|
||
error: unused import: `use foo::{};` | ||
--> $DIR/use-nested-groups-unused-imports.rs:30:1 | ||
| | ||
30 | use foo::{}; | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|