Skip to content

feat(unnecessary_self_imports): lint nested imports - #17653

Merged
dswij merged 1 commit into
rust-lang:masterfrom
ada4a:17652-unnecessary_self_imports
Sep 1, 2026
Merged

feat(unnecessary_self_imports): lint nested imports#17653
dswij merged 1 commit into
rust-lang:masterfrom
ada4a:17652-unnecessary_self_imports

Conversation

@ada4a

@ada4a ada4a commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Resolves #17652

changelog: [unnecessary_self_imports]: lint nested imports

@rustbot rustbot added the S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. label Aug 29, 2026
@rustbot

rustbot commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request. A reviewer will take a look after it receives 2 community reviews.

In the meantime, we would highly appreciate if you could try to review any of PRs waiting on community reviews.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 29, 2026
@ada4a
ada4a force-pushed the 17652-unnecessary_self_imports branch from f068bb3 to 0b1874b Compare August 29, 2026 15:05
@ada4a
ada4a force-pushed the 17652-unnecessary_self_imports branch from 0b1874b to c85ce51 Compare August 29, 2026 15:10

@mathstuf mathstuf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Perhaps add a test importing ::{self, Item} to check the span reports the removal of the {, } bits as well? Same with ::{self, Item, OtherItem} not removing the braces, but removing the , .

View changes since this review

@mathstuf mathstuf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this doesn't care about use of self, so my suggested test additions are not relevant to this lint as ::{self, Anything} is not necessarily an unnecessary use (and therefore subject to "unused import" lints).

View changes since this review

@ada4a

ada4a commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

as ::{self, Anything} is not necessarily an unnecessary use (and therefore subject to "unused import" lints).

Exactly right. Thank you for the review:)

@CommanderStorm CommanderStorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Community review: LGTM, no suggestions.

View changes since this review

@rustbot rustbot removed the S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. label Aug 31, 2026
@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

r? @dswij

rustbot has assigned @dswij for the project review.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 9 candidates
  • 9 candidates expanded to 9 candidates
  • Random selection from Jarcho, Manishearth, blyxyas, dswij, llogiq

@dswij
dswij added this pull request to the merge queue Sep 1, 2026
Merged via the queue into rust-lang:master with commit 3ce9fd2 Sep 1, 2026
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 1, 2026
@ada4a
ada4a deleted the 17652-unnecessary_self_imports branch September 1, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unnecessary_self_imports doesn't trigger in nested imports

5 participants