Skip to content

Fix async drop multi crate crash#153274

Open
ValorZard wants to merge 1 commit intorust-lang:mainfrom
ValorZard:async-drop-multi-crate-crash
Open

Fix async drop multi crate crash#153274
ValorZard wants to merge 1 commit intorust-lang:mainfrom
ValorZard:async-drop-multi-crate-crash

Conversation

@ValorZard
Copy link

@ValorZard ValorZard commented Mar 2, 2026

fixes #142572
Again, I've been talking in the Zulip about this: #wg-async > is there a way I can help with Async Drop? @ 💬

TL;DR: This is going to be a bit of a refactor, hold your horses

Also, I might end up splitting this into two PRs, so I can first merge my elaborate_drop.rs refactor, and then my fix for the crash later, but IDK yet

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 2, 2026
@rust-log-analyzer

This comment has been minimized.

@ValorZard ValorZard marked this pull request as ready for review March 2, 2026 06:57
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot 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 Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, mir, mir-opt
  • compiler, mir, mir-opt expanded to 69 candidates
  • Random selection from 15 candidates

@rustbot

This comment has been minimized.

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Mar 2, 2026
@ValorZard ValorZard changed the title [WIP] Attempt to fix async drop multi crate crash Fix async drop multi crate crash Mar 2, 2026
@ValorZard ValorZard force-pushed the async-drop-multi-crate-crash branch from b12bea5 to 9375f85 Compare March 2, 2026 06:59
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot rustbot removed the has-merge-commits PR has merge commits, merge with caution. label Mar 2, 2026
@ValorZard ValorZard force-pushed the async-drop-multi-crate-crash branch from 9375f85 to c757f7a Compare March 2, 2026 07:01
@ValorZard
Copy link
Author

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned davidtwco Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

@ValorZard ValorZard force-pushed the async-drop-multi-crate-crash branch from c757f7a to ab792af Compare March 2, 2026 07:55
@petrochenkov petrochenkov added the F-async_drop `#![feature(async_drop)]` label Mar 2, 2026
/// Function to check if we can generate an async drop here
fn check_if_can_async_drop(&mut self, drop_ty: Ty<'tcx>, call_destructor_only: bool) -> bool {
let is_async_drop_feature_enabled = if self.tcx().features().async_drop() {
true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could do if self.tcx().features().staged_api() { span_bug!(some_span, "don't use async drop in libstd, it becomes insta-stable") } (and similarly at the other use of async_drop in adt_constructor

@oli-obk
Copy link
Contributor

oli-obk commented Mar 2, 2026

if you write fixes #142572 in the main PR message, the issue will automatically be closed when the PR merges

@ValorZard ValorZard force-pushed the async-drop-multi-crate-crash branch from ab792af to 2414f6d Compare March 2, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-async_drop `#![feature(async_drop)]` 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

segmentation fault when using async_drop feature

6 participants