Skip to content

Fix ICE in tail_expr_drop_order lint with async drops - #166003

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
coleleavitt:main
Nov 17, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
coleleavitt:main

Conversation

@coleleavitt

@coleleavitt coleleavitt commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

fixes #142155. ForLint arm of build_scope_drops doesnt advance dropline_to. diverge_dropline_target adds a coroutine drop-tree node for every scheduled drop (Value, Storage, ForLint) but only Value and Storage step the cursor. when tail_expr_drop_order is enabled (-W rust-2024-compatibility, cargo fix --edition) and the scope has an async-drop value the cursor lags one node and the Storage arm's debug_assert_eq! fires. The fix adds the same 4-line if-let block the Storage arm has. #164987 attempted a fix in needs_async_drop which was reverted in #165266.

@rustbot

rustbot commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 15, 2026
@rustbot

rustbot commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @panstromek (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 79 candidates
  • Random selection from 21 candidates

@rustbot

This comment has been minimized.

@coleleavitt

Copy link
Copy Markdown
Contributor Author

⚠️ Warning ⚠️

* There are issue links (such as `#123`) in the commit messages of the following commits.
  _Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtrees._
  
  * [6fdfaf8](https://github.com/rust-lang/rust/commit/6fdfaf830500f477029112275335a90504702a0f)

sorry about that

@panstromek

panstromek commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

This looks correct to me but I don't know this part of the codebase well enough to say definitely.

r? cjgillot maybe?

@rustbot rustbot assigned cjgillot and unassigned panstromek Nov 15, 2026
@cjgillot

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit de513d0 has been approved by cjgillot

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 17, 2026
Rollup of 15 pull requests

Successful merges:

 - #166054 (stdarch subtree update)
 - #165939 (Convert `pretty-std` debuginfo test to `gdb-repr`)
 - #165289 (lexer: Update to Unicode 18)
 - #165960 (alloctests: use thread-local in `c_str_alloc_error`)
 - #166002 (#[optimize]: keep low opt levels unoptimized)
 - #166003 (Fix ICE in tail_expr_drop_order lint with async drops)
 - #166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets)
 - #165200 (fix abi kind of thumb windows targets)
 - #165966 (Document failing cases for spawning processes when using Command)
 - #165999 (Update TPDE submodule)
 - #166045 (rustdoc: Correctly filter deref impls on type aliases)
 - #166063 (Fix bad hyperlink)
 - #166066 (Update books)
 - #166072 (simplify Appearances iter)
 - #166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
@rust-bors
rust-bors Bot merged commit bde9b1c into rust-lang:main Nov 17, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 17, 2026
Rollup merge of #166003 - coleleavitt:main, r=cjgillot

Fix ICE in tail_expr_drop_order lint with async drops

fixes #142155. `ForLint` arm of `build_scope_drops` doesnt advance `dropline_to`. `diverge_dropline_target` adds a coroutine drop-tree node for every scheduled drop (Value, Storage, ForLint) but only Value and Storage step the cursor. when `tail_expr_drop_order` is enabled (`-W rust-2024-compatibility`, `cargo fix --edition`) and the scope has an async-drop value the cursor lags one node and the Storage arm's `debug_assert_eq!` fires. The fix adds the same 4-line if-let block the Storage arm has. #164987 attempted a fix in `needs_async_drop` which was reverted in #165266.
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE in tail_expr_drop_order lint

4 participants