Detect missing binding available: add a MaybeIncorrect suggestion - #161180
Open
GTimothy wants to merge 2 commits into
Open
Detect missing binding available: add a MaybeIncorrect suggestion#161180GTimothy wants to merge 2 commits into
GTimothy wants to merge 2 commits into
Conversation
When a pattern has `..` and a matching binding, suggest replacing `..` with `binding, ..`
Contributor
Author
|
@rustbot r? mu001999 |
12 tasks
GTimothy
marked this pull request as ready for review
August 16, 2026 17:02
Contributor
Author
|
@rustbot ready |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When suggesting that a missing binding is available in a pattern but not used, if it is behind a
..suggest a MaybeIncorrect fix replacing..with{binding}, ..This suggestion could be a
tool_only_suggestion, or aspan_suggestion_hidden. Other types of suggestions seem a bit too verbose for this simple case.The
tool_only_suggestion(first commit) does not add any suggestion in stderr, thespan_suggestion_hidden(second commit) shows a minimal help line.This work was extracted from PR #156239.