Handle DropKind::ForLint in coroutines correctly#134575
Handle DropKind::ForLint in coroutines correctly#134575bors merged 1 commit intorust-lang:masterfrom
DropKind::ForLint in coroutines correctly#134575Conversation
| unwind_to = unwind_drops.drops[unwind_to].next; | ||
| } | ||
|
|
||
| // If the operand has been moved, and we are not on an unwind |
There was a problem hiding this comment.
We want to do this early skip after we've adjusted the unwind_to block.
There was a problem hiding this comment.
At least I think we do -- this isn't realted, though.
There was a problem hiding this comment.
Yes, I think you're right, that seems to match what happens above. It makes sense that we would do it after.
| for (drop_idx, drop_node) in drops.drops.iter_enumerated().skip(1) { | ||
| match drop_node.data.kind { | ||
| DropKind::Storage => { | ||
| DropKind::Storage | DropKind::ForLint => { |
There was a problem hiding this comment.
This is the fix for the ICE. Not totally sure why it fixes it :?
There was a problem hiding this comment.
Hmm. I think it fixes it because we generally copied the "storage" logic -- i.e., we only adjust unwind_to when storage_dead_on_unwind is true. I'm not 100% sure what the "add entry point" business is about though.
There was a problem hiding this comment.
OK, I did a bit of looking, I think this is correct, and it has to do with the fact that we are inserting a statement into a block and not a terminator.
|
I think only @nikomatsakis can review this r? nikomatsakis |
|
Looking |
nikomatsakis
left a comment
There was a problem hiding this comment.
At first glance it seems reasonable. I'm going to be afk for about 7 hours, I can do a more detailed review tonight.
This comment has been minimized.
This comment has been minimized.
593679c to
42d1a4c
Compare
|
@bors r+ |
Rollup of 7 pull requests Successful merges: - rust-lang#133087 (Detect missing `.` in method chain in `let` bindings and statements) - rust-lang#134575 (Handle `DropKind::ForLint` in coroutines correctly) - rust-lang#134576 (Improve prose around basic examples of Iter and IterMut) - rust-lang#134577 (Improve prose around `as_slice` example of Iter) - rust-lang#134579 (Improve prose around into_slice example of IterMut) - rust-lang#134593 (Less unwrap() in documentation) - rust-lang#134600 (Fix parenthesization of chained comparisons by pretty-printer) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#134575 - compiler-errors:drop-lint-coro, r=nikomatsakis Handle `DropKind::ForLint` in coroutines correctly Fixes rust-lang#134566 Fixes rust-lang#134541
|
Nominating this for beta b/c it goes along with #134486 |
[beta] backports - Do not call `extern_crate` on current trait on crate mismatch errors rust-lang#133585 - Correctly handle comments in attributes in doctests source code rust-lang#134260 - Correctly document CTFE behavior of is_null and methods that call is_null. rust-lang#134325 - Make sure we handle `backwards_incompatible_lint` drops appropriately in drop elaboration rust-lang#134486 - Bump compiler `cc` to 1.2.5 rust-lang#134505 - Handle `DropKind::ForLint` in coroutines correctly rust-lang#134575 - docs: inline `std::ffi::c_str` types to `std::ffi` rust-lang#134791 - docs: inline `alloc::ffi::c_str` types to `alloc::ffi` rust-lang#134851 r? cuviper
Fixes #134566
Fixes #134541