Skip to content

Detect missing binding available: add a MaybeIncorrect suggestion - #161180

Open
GTimothy wants to merge 2 commits into
rust-lang:mainfrom
GTimothy:detect_missing_binding_available-suggestion
Open

Detect missing binding available: add a MaybeIncorrect suggestion#161180
GTimothy wants to merge 2 commits into
rust-lang:mainfrom
GTimothy:detect_missing_binding_available-suggestion

Conversation

@GTimothy

Copy link
Copy Markdown
Contributor

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 a span_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, the span_suggestion_hidden (second commit) shows a minimal help line.

This work was extracted from PR #156239.

When a pattern has `..` and a matching binding, suggest replacing `..`
with `binding, ..`
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 16, 2026
@GTimothy

Copy link
Copy Markdown
Contributor Author

@rustbot r? mu001999

@GTimothy
GTimothy marked this pull request as ready for review August 16, 2026 17:02
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 16, 2026
@GTimothy

Copy link
Copy Markdown
Contributor Author

@rustbot ready

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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants