-
Notifications
You must be signed in to change notification settings - Fork 13.3k
async drop cause ICE #140426
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
Labels
C-bug
Category: This is a bug.
F-async_drop
`#![feature(async_drop)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-incomplete-features
This issue requires the use of incomplete features.
S-has-bisection
Status: a bisection has been found for this issue
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
cc @azhogin |
simpler: #![feature(async_drop)]
use std::task::Context;
fn f() -> Context<'static> {
todo!()
}
fn main() {
let mut body = Box::pin(async {});
let _ = body.as_mut().poll(&mut f());
} |
Fix: #140630 |
Zalathar
added a commit
to Zalathar/rust
that referenced
this issue
May 4, 2025
…ource-info-fix, r=oli-obk Async drop source info fix for proxy-drop-coroutine Fixes crash at debug info generation: rust-lang#140426 . Also, the submitted example requires sync Drop implementation too. Because sync version is required for unwind and when drop is performed in sync context (sync function). Probably, it is also needed to add such a lint/error about missed `impl Drop`, when there is `impl AsyncDrop`. Fix description: even minimal, empty coroutine (for proxy-coroutine) has 3 states and the source info array should have 3 elements too. ``` #![feature(async_drop)] use std::future::AsyncDrop; use std::pin::Pin; #[tokio::main(flavor = "current_thread")] async fn main() { let _st = St; } struct St; impl AsyncDrop for St { async fn drop(self: Pin<&mut Self>) { println!("123"); } } ```
tgross35
added a commit
to tgross35/rust
that referenced
this issue
May 4, 2025
…ource-info-fix, r=oli-obk Async drop source info fix for proxy-drop-coroutine Fixes crash at debug info generation: rust-lang#140426 . Also, the submitted example requires sync Drop implementation too. Because sync version is required for unwind and when drop is performed in sync context (sync function). Probably, it is also needed to add such a lint/error about missed `impl Drop`, when there is `impl AsyncDrop`. Fix description: even minimal, empty coroutine (for proxy-coroutine) has 3 states and the source info array should have 3 elements too. ``` #![feature(async_drop)] use std::future::AsyncDrop; use std::pin::Pin; #[tokio::main(flavor = "current_thread")] async fn main() { let _st = St; } struct St; impl AsyncDrop for St { async fn drop(self: Pin<&mut Self>) { println!("123"); } } ```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
May 5, 2025
Rollup merge of rust-lang#140630 - azhogin:azhogin/async-drop-proxy-source-info-fix, r=oli-obk Async drop source info fix for proxy-drop-coroutine Fixes crash at debug info generation: rust-lang#140426 . Also, the submitted example requires sync Drop implementation too. Because sync version is required for unwind and when drop is performed in sync context (sync function). Probably, it is also needed to add such a lint/error about missed `impl Drop`, when there is `impl AsyncDrop`. Fix description: even minimal, empty coroutine (for proxy-coroutine) has 3 states and the source info array should have 3 elements too. ``` #![feature(async_drop)] use std::future::AsyncDrop; use std::pin::Pin; #[tokio::main(flavor = "current_thread")] async fn main() { let _st = St; } struct St; impl AsyncDrop for St { async fn drop(self: Pin<&mut Self>) { println!("123"); } } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
F-async_drop
`#![feature(async_drop)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-incomplete-features
This issue requires the use of incomplete features.
S-has-bisection
Status: a bisection has been found for this issue
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: