Skip to content

Conversation

@alt440
Copy link

@alt440 alt440 commented Dec 25, 2025

Please write a short comment explaining your change (or "none" for internal only changes)
Fixes #16110
changelog: [similar_names] : Trigger similar_names lint when one name has 1 trailing character more than the other

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
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

@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@github-actions
Copy link

github-actions bot commented Dec 25, 2025

Lintcheck changes for 9b9de0f

Lint Added Removed Changed
clippy::similar_names 134 1 6

This comment will be updated if you push new changes

@Jarcho
Copy link
Contributor

Jarcho commented Jan 6, 2026

Given the fallout from this change it's probably better to change the example instead. cc @rust-lang/clippy

@alt440
Copy link
Author

alt440 commented Jan 7, 2026

@Jarcho If we do follow this route, the documentation would have to change to specify that the similar_names lint only considers variables with same length and similar characters.

Note that the change is bigger than just the similar_names lint file because of the dogfood tests. If it wasn't for that, the change is minor: see my first commit.

@Jarcho
Copy link
Contributor

Jarcho commented Jan 8, 2026

It just doesn't handle insertions at the start or end of the name. Single character insertions in the middle still trigger the lint.

Note that the change is bigger than just the similar_names lint file because of the dogfood tests. If it wasn't for that, the change is minor: see my first commit.

That's exactly what I mean by the fallout. A large number of the new lint emissions are quite questionable.

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

Labels

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.

similar_names not triggered by example

3 participants