-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Don't ICE on item in .await
expression
#62152
Merged
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
.await
expression
Centril
reviewed
Jun 26, 2019
Centril
reviewed
Jun 26, 2019
cramertj
reviewed
Jun 26, 2019
match self.yield_ty { | ||
Some(ty) => { | ||
self.check_expr_coercable_to_type(&value, ty); | ||
} | ||
None => { | ||
// Given that this `yield` expression was generated as a result of lowering a `.await`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cute!
@bors r+ Thanks so much! |
📌 Commit 5cb841d has been approved by |
🌲 The tree is currently closed for pull requests below priority 999, this pull request will be tested once the tree is reopened |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
bors
added a commit
that referenced
this pull request
Jun 28, 2019
Rollup of 16 pull requests Successful merges: - #61878 (improve pinning projection docs) - #62043 (Remove `FnBox`) - #62067 (Add suggestion for missing `.await` keyword) - #62076 (Updated RELEASES.md for 1.36.0) - #62102 (call out explicitly that general read needs to be called with an initialized buffer) - #62106 (Add more tests for async/await) - #62124 (refactor lexer to use idiomatic borrowing) - #62131 (libsyntax: Fix some Clippy warnings) - #62152 (Don't ICE on item in `.await` expression) - #62154 (Remove old fixme) - #62155 (Add regression test for MIR drop generation in async loops) - #62156 (Update books) - #62160 (Remove outdated question_mark_macro_sep lint) - #62164 (save-analysis: use buffered writes) - #62171 (rustc: Retry SIGILL linker invocations) - #62176 (Update RLS) 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.
The code for lowering a
.await
expression missed that item IDs may already have been assigned for items inside of anasync
block, or for closures. This change means we no longer exit early after finding a.await
in a block that isn'tasync
and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (TheYieldSource
of the generatedyield
expression is used to avoid errors generated about havingyield
expressions outside of generator literals.)r? @cramertj
Resolves #62009 and resolves #61685