Detect missing binding available: add a MaybeIncorrect suggestion - #161180
Merged
rust-bors[bot] merged 1 commit intoAug 25, 2026
Merged
Conversation
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 |
mu001999
reviewed
Aug 25, 2026
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
When a pattern has `..` and a matching binding, suggest replacing `..` with `binding, ..` bless tests Co-authored-by: Roland Xu <rcu@live.com>
GTimothy
force-pushed
the
detect_missing_binding_available-suggestion
branch
from
August 25, 2026 12:18
2d2e9a5 to
eb186bb
Compare
Contributor
Author
|
@rustbot ready |
Member
|
Thanks! @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 25, 2026
…ailable-suggestion, r=mu001999
Detect missing binding available: add a MaybeIncorrect suggestion
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 rust-lang#156239.
This was referenced Aug 25, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 25, 2026
…uwer Rollup of 13 pull requests Successful merges: - #158874 (hir_ty_lowering: fix anon const type recovery) - #161443 (add internal DSL for testing binders) - #161617 (Add custom allocators to `(try_)map` on `Box`, `Rc`, `Arc`) - #161726 (Fix debugger visualizer tuple child ordering w/ PDB debug info) - #161729 (miri subtree update) - #161745 (make trivial ABI check resilient against new repr) - #160871 (Remove `#[rustc_reservation_impl]`) - #161180 (Detect missing binding available: add a MaybeIncorrect suggestion) - #161522 (test `f16::mul_add` not double-rounding the result) - #161631 (Add two comments relating to new-solver performance) - #161724 (Add codegen test for static table search loop unrolling) - #161740 (do not compress debuginfo for Cygwin) - #161750 (vector ABI check: reword so it makes more sense for non-obviously-vector types)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 25, 2026
Rollup merge of #161180 - GTimothy:detect_missing_binding_available-suggestion, r=mu001999 Detect missing binding available: add a MaybeIncorrect suggestion 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.
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.