-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
resolve: disallow labelled breaks/continues through closures/async blocks #73726
Merged
bors
merged 1 commit into
rust-lang:master
from
davidtwco:issue-73541-labelled-break-through-closure-async
Jul 3, 2020
Merged
resolve: disallow labelled breaks/continues through closures/async blocks #73726
bors
merged 1 commit into
rust-lang:master
from
davidtwco:issue-73541-labelled-break-through-closure-async
Jul 3, 2020
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
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jun 25, 2020
estebank
reviewed
Jun 25, 2020
petrochenkov
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jun 26, 2020
davidtwco
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
Jun 27, 2020
davidtwco
force-pushed
the
issue-73541-labelled-break-through-closure-async
branch
from
June 27, 2020 18:05
e284e61
to
701df52
Compare
(I'm no longer on remote work, so I'll review with delays now.) |
petrochenkov
reviewed
Jul 2, 2020
Also the commits need squashing. |
petrochenkov
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jul 2, 2020
This commit modifies resolve to disallow `break`/`continue` to labels through closures or async blocks. This doesn't make sense and should have been prohibited anyway. Signed-off-by: David Wood <[email protected]>
davidtwco
force-pushed
the
issue-73541-labelled-break-through-closure-async
branch
from
July 2, 2020 12:52
701df52
to
cb541dc
Compare
Fixed! |
@bors r+ |
📌 Commit cb541dc 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-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Jul 2, 2020
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jul 2, 2020
…k-through-closure-async, r=petrochenkov resolve: disallow labelled breaks/continues through closures/async blocks Fixes rust-lang#73541. This PR modifies name resolution to prohibit labelled breaks/continues through closures or async blocks, fixing an ICE. In addition, it improves the diagnostics surrounding labelled breaks/continues through closures or async blocks by informing the user if the label exists in an parent scope and telling them that won't work. r? @petrochenkov (resolve) cc @estebank (diagnostic changes) @tmandry (issue is from `wg-async-foundations`)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 2, 2020
…arth Rollup of 8 pull requests Successful merges: - rust-lang#73454 (Move contributing.md to rustc-dev-guide and point at getting started) - rust-lang#73724 (Use WASM's saturating casts if they are available) - rust-lang#73726 (resolve: disallow labelled breaks/continues through closures/async blocks) - rust-lang#73753 (Use 'tcx for references to AccessLevels wherever possible.) - rust-lang#73781 (Update psm version) - rust-lang#73952 (Add option for local docker testing.) - rust-lang#73957 (disable BTree min_max test in Miri for now) - rust-lang#73975 (Document rustc_ast::ast::Pat) Failed merges: r? @ghost
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.
Fixes #73541.
This PR modifies name resolution to prohibit labelled breaks/continues through closures or async blocks, fixing an ICE. In addition, it improves the diagnostics surrounding labelled breaks/continues through closures or async blocks by informing the user if the label exists in an parent scope and telling them that won't work.
r? @petrochenkov (resolve)
cc @estebank (diagnostic changes) @tmandry (issue is from
wg-async-foundations
)