Skip to content

Unused import prefixes#17246

Open
hafihaf123 wants to merge 5 commits into
rust-lang:masterfrom
hafihaf123:unused_import_prefixes
Open

Unused import prefixes#17246
hafihaf123 wants to merge 5 commits into
rust-lang:masterfrom
hafihaf123:unused_import_prefixes

Conversation

@hafihaf123

@hafihaf123 hafihaf123 commented Jun 14, 2026

Copy link
Copy Markdown

Adds a new nursery lint, unused_import_prefixes, which detects and suggests removing redundant crate::... prefixes in use statements when importing items that are descendants of the current module.

Fixes #17084

  • Followed lint naming conventions
  • Added passing UI tests (including committed .stderr file)
  • cargo test passes locally
  • Executed cargo dev update_lints
  • Added lint documentation
  • Run cargo dev fmt

changelog: new lint: [unused_import_prefixes]

@rustbot rustbot added needs-fcp PRs that add, remove, or rename lints and need an FCP S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jun 14, 2026
@rustbot

rustbot commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dswij (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 8 candidates
  • 8 candidates expanded to 8 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

Lintcheck changes for 473b125

Lint Added Removed Changed
clippy::unused_import_prefixes 53 0 0

This comment will be updated if you push new changes

@hafihaf123 hafihaf123 marked this pull request as draft June 14, 2026 23:35
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 14, 2026
@hafihaf123 hafihaf123 marked this pull request as ready for review June 15, 2026 12:56
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 15, 2026
@rustbot

This comment has been minimized.

@hafihaf123 hafihaf123 force-pushed the unused_import_prefixes branch from 02dd264 to 473b125 Compare June 16, 2026 14:50
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-fcp PRs that add, remove, or rename lints and need an FCP S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove redundant crate::x prefix in imports

3 participants