Open
Description
Code
#![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");
}
}
Meta
rustc --version --verbose
:
rustc 1.88.0-nightly (25cdf1f67 2025-04-28)
binary: rustc
commit-hash: 25cdf1f67463c9365d8d83778c933ec7480e940b
commit-date: 2025-04-28
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2
Error output
thread 'rustc' panicked at compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs:201:68:
index out of bounds: the len is 1 but the index is 1
stack backtrace:
0: 0x796006a642e5 - std::backtrace::Backtrace::create::h5b5d29f0fcbef4c5
1: 0x796004ef3855 - std::backtrace::Backtrace::force_capture::h46ea152eb057a4f7
2: 0x796003f86011 - std[96024a80e4ce12a0]::panicking::update_hook::<alloc[703cfcb04acfdfda]::boxed::Box<rustc_driver_impl[a2bbb3d7e654019c]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x796004f0d933 - std::panicking::rust_panic_with_hook::h7afddb00f409503c
4: 0x796004f0d62a - std::panicking::begin_panic_handler::{{closure}}::h11311e14e26011d8
5: 0x796004f098d9 - std::sys::backtrace::__rust_end_short_backtrace::h4a69b8a8bf83181b
6: 0x796004f0d2ed - __rustc[ae73a5f87904751]::rust_begin_unwind
7: 0x79600188d0d0 - core::panicking::panic_fmt::he7bfe01c5f8a6b92
8: 0x7960033d8005 - core::panicking::panic_bounds_check::h60b2f61c06b46463
9: 0x796003dd9633 - <core[6d7144d1d4266374]::iter::adapters::map::Map<core[6d7144d1d4266374]::iter::adapters::map::Map<core[6d7144d1d4266374]::ops::range::Range<usize>, <rustc_index[6fcb69c322e18028]::slice::IndexSlice<rustc_abi[16b420aafa014dd]::layout::ty::VariantIdx, rustc_abi[16b420aafa014dd]::LayoutData<rustc_abi[16b420aafa014dd]::layout::ty::FieldIdx, rustc_abi[16b420aafa014dd]::layout::ty::VariantIdx>>>::indices::{closure#0}>, rustc_codegen_llvm[4025aff5dfb5e881]::debuginfo::metadata::enums::native::build_coroutine_di_node::{closure#0}::{closure#0}> as core[6d7144d1d4266374]::iter::traits::iterator::Iterator>::next
10: 0x796003e0681f - rustc_codegen_llvm[4025aff5dfb5e881]::debuginfo::metadata::enums::native::build_coroutine_di_node
11: 0x796005d23bfd - rustc_codegen_llvm[4025aff5dfb5e881]::debuginfo::metadata::type_di_node
12: 0x7960062b9372 - <rustc_codegen_llvm[4025aff5dfb5e881]::context::GenericCx<rustc_codegen_llvm[4025aff5dfb5e881]::context::FullCx> as rustc_codegen_ssa[8010b3f9fa421608]::traits::debuginfo::DebugInfoCodegenMethods>::dbg_scope_fn
13: 0x796006645576 - rustc_codegen_ssa[8010b3f9fa421608]::mir::codegen_mir::<rustc_codegen_llvm[4025aff5dfb5e881]::builder::GenericBuilder<rustc_codegen_llvm[4025aff5dfb5e881]::context::FullCx>>
14: 0x796006643d45 - rustc_codegen_llvm[4025aff5dfb5e881]::base::compile_codegen_unit::module_codegen
15: 0x7960067dc4ec - <rustc_codegen_llvm[4025aff5dfb5e881]::LlvmCodegenBackend as rustc_codegen_ssa[8010b3f9fa421608]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
16: 0x7960067de2dc - <rustc_codegen_llvm[4025aff5dfb5e881]::LlvmCodegenBackend as rustc_codegen_ssa[8010b3f9fa421608]::traits::backend::CodegenBackend>::codegen_crate
17: 0x79600658b29d - <rustc_interface[269edf8a537b00a5]::queries::Linker>::codegen_and_build_linker
18: 0x79600658f46f - rustc_interface[269edf8a537b00a5]::passes::create_and_enter_global_ctxt::<core[6d7144d1d4266374]::option::Option<rustc_interface[269edf8a537b00a5]::queries::Linker>, rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
19: 0x7960066eceb9 - rustc_interface[269edf8a537b00a5]::interface::run_compiler::<(), rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}>::{closure#1}
20: 0x796006501728 - std[96024a80e4ce12a0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[269edf8a537b00a5]::util::run_in_thread_with_globals<rustc_interface[269edf8a537b00a5]::util::run_in_thread_pool_with_globals<rustc_interface[269edf8a537b00a5]::interface::run_compiler<(), rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
21: 0x796006501b74 - <<std[96024a80e4ce12a0]::thread::Builder>::spawn_unchecked_<rustc_interface[269edf8a537b00a5]::util::run_in_thread_with_globals<rustc_interface[269edf8a537b00a5]::util::run_in_thread_pool_with_globals<rustc_interface[269edf8a537b00a5]::interface::run_compiler<(), rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6d7144d1d4266374]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
22: 0x796006502f77 - std::sys::pal::unix::thread::Thread::new::thread_start::h7eeb46109c9d7745
23: 0x7960004a3708 - <unknown>
24: 0x796000527aac - <unknown>
25: 0x0 - <unknown>
rustc version: 1.88.0-nightly (25cdf1f67 2025-04-28)
platform: x86_64-unknown-linux-gnu
query stack during panic:
end of query stack
Backtrace
warning: `rust_learn` (lib) generated 10 warnings
Compiling rust_learn v0.1.0 (/home/sherlock/git/rust_learn)
warning: the feature `async_drop` is incomplete and may not be safe to use and/or cause compiler crashes
--> src/main.rs:1:12
|
1 | #![feature(async_drop)]
| ^^^^^^^^^^
|
= note: see issue #126482 <https://github.com/rust-lang/rust/issues/126482> for more information
= note: `#[warn(incomplete_features)]` on by default
thread 'rustc' panicked at compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs:201:68:
index out of bounds: the len is 1 but the index is 1
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic_bounds_check
3: <core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::ops::range::Range<usize>, <rustc_index::slice::IndexSlice<rustc_abi::layout::ty::VariantIdx, rustc_abi::LayoutData<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::VariantIdx>>>::indices::{closure#0}>, rustc_codegen_llvm::debuginfo::metadata::enums::native::build_coroutine_di_node::{closure#0}::{closure#0}> as core::iter::traits::iterator::Iterator>::next
4: rustc_codegen_llvm::debuginfo::metadata::enums::native::build_coroutine_di_node
5: rustc_codegen_llvm::debuginfo::metadata::type_di_node
6: <rustc_codegen_llvm::context::GenericCx<rustc_codegen_llvm::context::FullCx> as rustc_codegen_ssa::traits::debuginfo::DebugInfoCodegenMethods>::dbg_scope_fn
7: rustc_codegen_ssa::mir::codegen_mir::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
8: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
9: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
10: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
11: <rustc_interface::queries::Linker>::codegen_and_build_linker
12: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
13: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please make sure that you have updated to the latest nightly
note: please attach the file at `/home/sherlock/git/rust_learn/rustc-ice-2025-04-29T04_54_17-46614.txt` to your bug report
note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=mold -C target_cpu=x86-64-v2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
warning: `rust_learn` (bin "rust_learn") generated 1 warning
error: could not compile `rust_learn` (bin "rust_learn"); 1 warning emitted
Caused by:
process didn't exit successfully: `/home/sherlock/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name rust_learn --edition=2024 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=145 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=fb7b476e0fb91d00 -C extra-filename=-93aff6a2681aca3a --out-dir /home/sherlock/git/rust_learn/target/debug/deps -C linker=clang -C incremental=/home/sherlock/git/rust_learn/target/debug/incremental -L dependency=/home/sherlock/git/rust_learn/target/debug/deps --extern anyhow=/home/sherlock/git/rust_learn/target/debug/deps/libanyhow-74d7e532cb662382.rlib --extern base64=/home/sherlock/git/rust_learn/target/debug/deps/libbase64-b2029bca7ba742fd.rlib --extern boringtun=/home/sherlock/git/rust_learn/target/debug/deps/libboringtun-fb8f467de899efca.rlib --extern bytes=/home/sherlock/git/rust_learn/target/debug/deps/libbytes-57c854b92fb36f5f.rlib --extern flume=/home/sherlock/git/rust_learn/target/debug/deps/libflume-94918a6a859e1ac7.rlib--extern futures_executor=/home/sherlock/git/rust_learn/target/debug/deps/libfutures_executor-56574f3565f22979.rlib --extern futures_util=/home/sherlock/git/rust_learn/target/debug/deps/libfutures_util-2f52708d7abfe127.rlib --extern ipnet=/home/sherlock/git/rust_learn/target/debug/deps/libipnet-254946b8fead8f77.rlib --extern iprange=/home/sherlock/git/rust_learn/target/debug/deps/libiprange-8cd98ef3265ffcb2.rlib --extern nix=/home/sherlock/git/rust_learn/target/debug/deps/libnix-fee0b09f6160ee7c.rlib --extern pnet_packet=/home/sherlock/git/rust_learn/target/debug/deps/libpnet_packet-90fb7050bfa37f43.rlib --extern quinn=/home/sherlock/git/rust_learn/target/debug/deps/libquinn-739b5bbc0f060e89.rlib --extern rand=/home/sherlock/git/rust_learn/target/debug/deps/librand-bdc15f51fdeab9dd.rlib --extern reqwest=/home/sherlock/git/rust_learn/target/debug/deps/libreqwest-f47bea0702c5c232.rlib --extern rtnetlink=/home/sherlock/git/rust_learn/target/debug/deps/librtnetlink-4e2782cdfb90bfcc.rlib --extern rust_learn=/home/sherlock/git/rust_learn/target/debug/deps/librust_learn-ec431fef5dc1d3f0.rlib --extern rustix=/home/sherlock/git/rust_learn/target/debug/deps/librustix-5b09b6145c82262d.rlib --extern rustls=/home/sherlock/git/rust_learn/target/debug/deps/librustls-8e844aeb78763f58.rlib --extern rustls_pemfile=/home/sherlock/git/rust_learn/target/debug/deps/librustls_pemfile-c67d38ca0c30ad21.rlib --extern tokio=/home/sherlock/git/rust_learn/target/debug/deps/libtokio-2f7727a06e5320e8.rlib --extern tun=/home/sherlock/git/rust_learn/target/debug/deps/libtun-ed284292b005c33b.rlib --extern zstd=/home/sherlock/git/rust_learn/target/debug/deps/libzstd-98787fde8924148c.rlib -C link-arg=-fuse-ld=mold -C target_cpu=x86-64-v2 -L native=/home/sherlock/git/rust_learn/target/debug/build/ring-0f8e4983219a3701/out -L native=/home/sherlock/git/rust_learn/target/debug/build/aws-lc-sys-0251f069c59f193d/out -L native=/home/sherlock/git/rust_learn/target/debug/build/zstd-sys-99c3c8f409528740/out` (exit status: 101)
Metadata
Metadata
Assignees
Labels
Category: This is a bug.`#![feature(async_drop)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: a bisection has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires the use of incomplete features.