-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gracefully handle loop labels missing leading '
in different positions
#81236
Merged
Conversation
This file contains 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
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jan 21, 2021
estebank
commented
Jan 21, 2021
This comment has been minimized.
This comment has been minimized.
oli-obk
requested changes
Jan 21, 2021
estebank
force-pushed
the
everybody-loop-now
branch
from
January 22, 2021 05:22
228c0ff
to
6169d20
Compare
When encountering a name `a` that isn't resolved, but a label `'a` is found in the current ribs, only suggest `'a` if this name is the value expression of a `break` statement. Solve FIXME.
Point at loop head on invalid `break expr`. Suggest removing `expr` or using label if available.
When encountering the following typo: ```rust a: loop { break 'a; } ``` provide an appropriate suggestion.
estebank
force-pushed
the
everybody-loop-now
branch
from
January 22, 2021 05:43
6169d20
to
9e82329
Compare
@bors r+ |
📌 Commit 9e82329 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 22, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 22, 2021
Rollup of 10 pull requests Successful merges: - rust-lang#80573 (Deny rustc::internal lints for rustdoc and clippy) - rust-lang#81173 (Expand docs on Iterator::intersperse) - rust-lang#81194 (Stabilize std::panic::panic_any.) - rust-lang#81202 (Don't prefix 0x for each segments in `dbg!(Ipv6)`) - rust-lang#81225 (Make 'docs' nullable in rustdoc-json output) - rust-lang#81227 (Remove doctree::StructType) - rust-lang#81233 (Document why not use concat! in dbg! macro) - rust-lang#81236 (Gracefully handle loop labels missing leading `'` in different positions) - rust-lang#81241 (Turn alloc's force_expr macro into a regular macro_rules.) - rust-lang#81242 (Enforce statically that `MIN_NON_ZERO_CAP` is calculated at compile time) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jan 30, 2021
Gracefully handle loop labels missing leading `'` in different positions Fix rust-lang#81192. * Account for labels when suggesting `loop` instead of `while true` * Suggest `'a` when given `a` only when appropriate * Add loop head span to hir * Tweak error for invalid `break expr` * Add more misspelled label tests * Avoid emitting redundant "unused label" lint * Parse loop labels missing a leading `'` Each commit can be reviewed in isolation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Fix #81192.
loop
instead ofwhile true
'a
when givena
only when appropriatebreak expr
'
Each commit can be reviewed in isolation.