-
Notifications
You must be signed in to change notification settings - Fork 13.3k
when dependency enable async_drop feature, it cause ICE #140858
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-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
I write a reproducible codes rustc version
dep alib.rs // #![cfg_attr(feature = "async_drop", feature(async_drop))]
// #![cfg_attr(feature = "async_drop", allow(incomplete_features))]
#![feature(async_drop)]
#![allow(incomplete_features)]
pub struct St;
impl St {
pub async fn p(&self) {
println!("async");
}
}
impl Drop for St {
fn drop(&mut self) {
println!("456")
}
}
// #[cfg(feature = "async_drop")]
impl std::future::AsyncDrop for St {
async fn drop(self: std::pin::Pin<&mut Self>) {
doit().await;
println!("123");
}
}
async fn doit() {
println!("123");
} project bCargo.toml [package]
name = "b"
version = "0.1.0"
edition = "2024"
[dependencies]
a = { path = "../a" }
tokio = { version = "1.45.0", features = ["rt", "macros"] } main.rs #![feature(async_drop)]
#![allow(incomplete_features)]
#[tokio::main(flavor = "current_thread")]
async fn main() {
doit().await
}
async fn doit() {
let st = a::St{};
st.p().await;
}
|
cc @azhogin |
Smaller, and with no deps: // src/lib.rs
#![feature(async_drop)]
#![allow(incomplete_features)]
pub struct St;
impl Drop for St {
fn drop(&mut self) { }
}
impl std::future::AsyncDrop for St {
async fn drop(self: std::pin::Pin<&mut Self>) { }
} // src/main.rs
#![feature(async_drop)]
#![allow(incomplete_features)]
async fn doit() {
let st = mycrate::St{};
}
fn main(){} Same stacktrace and very similar mcve as #140906 , so the two are probably duplicates. (Although this one curiously requires @rustbot label: -E-needs-mcve +S-has-mcve +requires-incomplete-features |
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-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
the lib.rs https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=e3445d1d48c59d1535129148ff8ff681
the main.rs https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=71b08ed816421d78b89b213eaedba212
the
user_stack
crate is a local project and not yet open source, but it enabled theasync_drop
nightly feature by add dep in Cargo.tomlMeta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: