-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix spans in unused import lint for nested groups #47726
Fix spans in unused import lint for nested groups #47726
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors r+ |
📌 Commit 0847ac0 has been approved by |
…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
…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
This fixes an inconsistency for empty nested groups, and adds a test for all the possible cases of the lint.
cc #44494