Skip to content

ICE in (25cdf1f67 2025-04-28) #140423

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

Open
Wyvern opened this issue Apr 29, 2025 · 7 comments
Open

ICE in (25cdf1f67 2025-04-28) #140423

Wyvern opened this issue Apr 29, 2025 · 7 comments
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) ❄️ 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

@Wyvern
Copy link

Wyvern commented Apr 29, 2025

error: internal compiler error: compiler/rustc_mir_transform/src/elaborate_drop.rs:1254:18: open drop from non-ADT `T/#0`
  --> /rustc/25cdf1f67463c9365d8d83778c933ec7480e940b/library/core/src/future/async_drop.rs:48:70
   |
48 |   pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) {
   |  ______________________________________________________________________^
...  |
51 | | }
   | |_^


thread 'rustc' panicked at compiler/rustc_mir_transform/src/elaborate_drop.rs:1254:18:
Box<dyn Any>
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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: rustc 1.88.0-nightly (25cdf1f67 2025-04-28) running on aarch64-apple-darwin

note: compiler flags: --crate-type rlib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 -Z unstable-options -Z remap-path-scope=all -Z force-unstable-if-unmarked -Z cross-crate-inline-threshold=yes -C rpath -C strip=debuginfo -Z force-unstable-if-unmarked -C target-feature=-crt-static -C symbol-mangling-version=hashed -C overflow-checks=no -C force-frame-pointers=no -C force-unwind-tables=no -C opt-level=s -C no-redzone -C debuginfo=0 -C strip=symbols -C collapse-macro-debuginfo=y -C panic=abort -Z unstable-options -Z export-executable-symbols -Z no-profiler-runtime -Z location-detail=none -Z plt -Z thinlto -Z dylib-lto -Z no-generate-arange-section -Z dep-info-omit-d-target -Z polonius=next -Z trim-diagnostic-paths -Z oom=abort -Z share-generics -Z merge-functions=aliases -Z inline-mir -Z inline-mir-preserve-debug=n -Z mir-opt-level=4 -Z packed-bundled-libs -Z maximal-hir-to-mir-coverage -Z terminal-urls -Z threads=0 -Z staticlib-allow-rdylib-deps -Z staticlib-prefer-dynamic -Z next-solver=coherence -Z panic-in-drop=abort -Z use-sync-unwind -Z graphviz-dark-mode -Z shell-argfiles -Z checksum-hash-algorithm=blake3 -Z trap-unreachable=no -Z mir-strip-debuginfo=all-locals -Z typing-mode-borrowck=y -Z experimental-default-bounds=y -C target-cpu=apple-m1 -Z tune-cpu=apple-m1 -C link-self-contained=+linker -Z linker-features=+lld -C link-arg=-Wl,--icf=all -C link-arg=-Wl,-no_uuid -C link-arg=-Wl,-S -C link-arg=-Wl,-dead_strip -C link-arg=-Wl,-dead_strip_dylibs -C link-arg=-Wl,-undefined,dynamic_lookup -Z binary-dep-depinfo -Z checksum-hash-algorithm=blake3

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_shims] generating MIR shim for `future::async_drop::async_drop_in_place::{closure#0}`, instance=AsyncDropGlue(DefId(0:15202 ~ core[46f5]::future::async_drop::async_drop_in_place::{closure#0}), Coroutine(DefId(0:15202 ~ core[46f5]::future::async_drop::async_drop_in_place::{closure#0}), [T/#0, (), future::ResumeTy, (), (), CoroutineWitness(DefId(0:15202 ~ core[46f5]::future::async_drop::async_drop_in_place::{closure#0}), [T/#0]), (*mut T/#0,)]))
#1 [layout_of] computing layout of `{async fn body of future::async_drop::async_drop_in_place<T>()}`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
error: could not compile `core` (lib)
@Wyvern Wyvern added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 29, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 29, 2025
@matthiaskrgr matthiaskrgr added the F-async_drop `#![feature(async_drop)]` label Apr 29, 2025
@jieyouxu jieyouxu added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Apr 29, 2025
@jieyouxu
Copy link
Member

Do you happen to have a complete reproducer?

@Houtamelo
Copy link
Contributor

I also ran into this issue and could not reproduce it after reverting c366756

@jieyouxu
Copy link
Member

Well yes, that PR definitely introduces this, it's just hard to come up with a regression test / root cause this without a complete reproducer and only based on an ICE backtrace.

@jieyouxu jieyouxu added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. and removed S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 30, 2025
@jieyouxu
Copy link
Member

jieyouxu commented May 9, 2025

FYI @azhogin, unfortunately we don't have a smaller repro

@antoyo
Copy link
Contributor

antoyo commented May 9, 2025

I don't know if this is small enough, but I created a reproducer here.
You can see the result in the CI here.

It seems necessary to set -Zmir-opt-level=3 to trigger this ICE.

I hope this helps.

@matthiaskrgr
Copy link
Member

matthiaskrgr commented May 9, 2025

ez

//@compile-flags --edition=2021 -Zmir-enable-passes=+DataflowConstProp
#![feature(async_drop)]
use std::mem::ManuallyDrop;
use std::{
    future::async_drop_in_place,
    pin::{pin, Pin},
};
fn main() {
    a(b)
}
fn b() {}
fn a<c>(d: c) {
    let e = pin!(ManuallyDrop::new(d));
    let f = unsafe { Pin::map_unchecked_mut(e, |g| &mut **g) };
    let h = unsafe { async_drop_in_place(f.get_unchecked_mut()) };
    h;
}
error: internal compiler error: compiler/rustc_mir_transform/src/elaborate_drop.rs:1254:18: open drop from non-ADT `c/#0`
  --> /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/async_drop.rs:48:70
   |
48 |   pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) {
   |  ______________________________________________________________________^
...  |
51 | | }
   | |_^


thread 'rustc' panicked at compiler/rustc_mir_transform/src/elaborate_drop.rs:1254:18:
Box<dyn Any>
stack backtrace:
   0:     0x784e5c763923 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h35b8f72326f85230
   1:     0x784e5ce05c07 - core::fmt::write::h73f5af0fa08ac030
   2:     0x784e5dee42d1 - std::io::Write::write_fmt::h0140e0dae4becf43
   3:     0x784e5c763782 - std::sys::backtrace::BacktraceLock::print::h2c50f8265df4edf7
   4:     0x784e5c76737a - std::panicking::default_hook::{{closure}}::h4f831a137f70e67f
   5:     0x784e5c766eff - std::panicking::default_hook::h47af645a18677257
   6:     0x784e5b795ef3 - std[e444442488e5ea2d]::panicking::update_hook::<alloc[24374ce535a764d]::boxed::Box<rustc_driver_impl[d80da60e87609ad4]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x784e5c767bf3 - std::panicking::rust_panic_with_hook::h2b8636e09e17cf97
   8:     0x784e5b7d1c81 - std[e444442488e5ea2d]::panicking::begin_panic::<rustc_errors[3eead5a99742680e]::ExplicitBug>::{closure#0}
   9:     0x784e5b7c5cb6 - std[e444442488e5ea2d]::sys::backtrace::__rust_end_short_backtrace::<std[e444442488e5ea2d]::panicking::begin_panic<rustc_errors[3eead5a99742680e]::ExplicitBug>::{closure#0}, !>
  10:     0x784e5b7c5b43 - std[e444442488e5ea2d]::panicking::begin_panic::<rustc_errors[3eead5a99742680e]::ExplicitBug>
  11:     0x784e5b7dc421 - <rustc_errors[3eead5a99742680e]::diagnostic::BugAbort as rustc_errors[3eead5a99742680e]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x784e5bdabc0c - <rustc_errors[3eead5a99742680e]::DiagCtxtHandle>::span_bug::<rustc_span[e6282e50b7a97c05]::span_encoding::Span, alloc[24374ce535a764d]::string::String>
  13:     0x784e5be49d47 - rustc_middle[dca19e53efad7b1b]::util::bug::opt_span_bug_fmt::<rustc_span[e6282e50b7a97c05]::span_encoding::Span>::{closure#0}
  14:     0x784e5be223ea - rustc_middle[dca19e53efad7b1b]::ty::context::tls::with_opt::<rustc_middle[dca19e53efad7b1b]::util::bug::opt_span_bug_fmt<rustc_span[e6282e50b7a97c05]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x784e5be2225b - rustc_middle[dca19e53efad7b1b]::ty::context::tls::with_context_opt::<rustc_middle[dca19e53efad7b1b]::ty::context::tls::with_opt<rustc_middle[dca19e53efad7b1b]::util::bug::opt_span_bug_fmt<rustc_span[e6282e50b7a97c05]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x784e5a24ce57 - rustc_middle[dca19e53efad7b1b]::util::bug::span_bug_fmt::<rustc_span[e6282e50b7a97c05]::span_encoding::Span>
  17:     0x784e5d5c0d64 - <rustc_mir_transform[c6aefdac698137fa]::elaborate_drop::DropCtxt<rustc_mir_transform[c6aefdac698137fa]::shim::DropShimElaborator>>::elaborate_drop
  18:     0x784e5d5ba9a1 - rustc_mir_transform[c6aefdac698137fa]::shim::make_shim
  19:     0x784e5d5b8a2f - rustc_query_impl[d196c070bbe03594]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d196c070bbe03594]::query_impl::mir_shims::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 8usize]>>
  20:     0x784e5d5b89e3 - <rustc_query_impl[d196c070bbe03594]::query_impl::mir_shims::dynamic_query::{closure#2} as core[ce1fa00964895ff1]::ops::function::FnOnce<(rustc_middle[dca19e53efad7b1b]::ty::context::TyCtxt, rustc_middle[dca19e53efad7b1b]::ty::instance::InstanceKind)>>::call_once
  21:     0x784e5d5a68c8 - rustc_query_system[ff49814a586d4008]::query::plumbing::try_execute_query::<rustc_query_impl[d196c070bbe03594]::DynamicConfig<rustc_query_system[ff49814a586d4008]::query::caches::DefaultCache<rustc_middle[dca19e53efad7b1b]::ty::instance::InstanceKind, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d196c070bbe03594]::plumbing::QueryCtxt, false>
  22:     0x784e5d5a65e6 - rustc_query_impl[d196c070bbe03594]::query_impl::mir_shims::get_query_non_incr::__rust_end_short_backtrace
  23:     0x784e5be46bb9 - <rustc_middle[dca19e53efad7b1b]::ty::context::TyCtxt>::coroutine_layout
  24:     0x784e5d4c0bc5 - rustc_ty_utils[76373251995fa178]::layout::layout_of_uncached
  25:     0x784e5d4b3b8e - rustc_ty_utils[76373251995fa178]::layout::layout_of
  26:     0x784e5d4b3aec - rustc_query_impl[d196c070bbe03594]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d196c070bbe03594]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 16usize]>>
  27:     0x784e5d4b290f - rustc_query_system[ff49814a586d4008]::query::plumbing::try_execute_query::<rustc_query_impl[d196c070bbe03594]::DynamicConfig<rustc_query_system[ff49814a586d4008]::query::caches::DefaultCache<rustc_middle[dca19e53efad7b1b]::ty::PseudoCanonicalInput<rustc_middle[dca19e53efad7b1b]::ty::Ty>, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[d196c070bbe03594]::plumbing::QueryCtxt, false>
  28:     0x784e5d4b2565 - rustc_query_impl[d196c070bbe03594]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  29:     0x784e5d8c8494 - <rustc_const_eval[3f5e4d3a96e28080]::interpret::eval_context::InterpCx<rustc_const_eval[3f5e4d3a96e28080]::const_eval::dummy_machine::DummyMachine> as rustc_middle[dca19e53efad7b1b]::ty::layout::LayoutOf>::spanned_layout_of
  30:     0x784e5c03d2d3 - <rustc_mir_transform[c6aefdac698137fa]::dataflow_const_prop::Collector>::try_make_constant
  31:     0x784e5bff06d2 - <rustc_mir_transform[c6aefdac698137fa]::dataflow_const_prop::OperandCollector as rustc_middle[dca19e53efad7b1b]::mir::visit::Visitor>::visit_operand
  32:     0x784e5c03c098 - <rustc_mir_transform[c6aefdac698137fa]::dataflow_const_prop::Collector as rustc_mir_dataflow[8785a9baa88b9056]::framework::visitor::ResultsVisitor<rustc_mir_transform[c6aefdac698137fa]::dataflow_const_prop::ConstAnalysis>>::visit_after_early_statement_effect
  33:     0x784e5c03ecba - <rustc_mir_transform[c6aefdac698137fa]::dataflow_const_prop::DataflowConstProp as rustc_mir_transform[c6aefdac698137fa]::pass_manager::MirPass>::run_pass
  34:     0x784e5ce03abd - rustc_mir_transform[c6aefdac698137fa]::pass_manager::run_passes_inner
  35:     0x784e5d9e3cc7 - rustc_mir_transform[c6aefdac698137fa]::run_optimization_passes
  36:     0x784e5d9e15bb - rustc_mir_transform[c6aefdac698137fa]::optimized_mir
  37:     0x784e5d9e115d - rustc_query_impl[d196c070bbe03594]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d196c070bbe03594]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 8usize]>>
  38:     0x784e5d23a77f - rustc_query_system[ff49814a586d4008]::query::plumbing::try_execute_query::<rustc_query_impl[d196c070bbe03594]::DynamicConfig<rustc_query_system[ff49814a586d4008]::query::caches::DefIdCache<rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d196c070bbe03594]::plumbing::QueryCtxt, false>
  39:     0x784e5d239b80 - rustc_query_impl[d196c070bbe03594]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  40:     0x784e5d5a0d3c - <rustc_middle[dca19e53efad7b1b]::ty::context::TyCtxt>::instance_mir
  41:     0x784e59cc2437 - rustc_monomorphize[a230bf6b05bd6360]::mono_checks::check_mono_item
  42:     0x784e5d5a41e0 - rustc_query_impl[d196c070bbe03594]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d196c070bbe03594]::query_impl::check_mono_item::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 0usize]>>
  43:     0x784e5d5a451c - rustc_query_system[ff49814a586d4008]::query::plumbing::try_execute_query::<rustc_query_impl[d196c070bbe03594]::DynamicConfig<rustc_query_system[ff49814a586d4008]::query::caches::DefaultCache<rustc_middle[dca19e53efad7b1b]::ty::instance::Instance, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d196c070bbe03594]::plumbing::QueryCtxt, false>
  44:     0x784e5d5a4194 - rustc_query_impl[d196c070bbe03594]::query_impl::check_mono_item::get_query_non_incr::__rust_end_short_backtrace
  45:     0x784e59ccbea9 - rustc_monomorphize[a230bf6b05bd6360]::collector::items_of_instance
  46:     0x784e5ce16772 - rustc_query_impl[d196c070bbe03594]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d196c070bbe03594]::query_impl::items_of_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 32usize]>>
  47:     0x784e5d852c98 - rustc_query_system[ff49814a586d4008]::query::plumbing::try_execute_query::<rustc_query_impl[d196c070bbe03594]::DynamicConfig<rustc_query_system[ff49814a586d4008]::query::caches::DefaultCache<(rustc_middle[dca19e53efad7b1b]::ty::instance::Instance, rustc_middle[dca19e53efad7b1b]::mir::mono::CollectionMode), rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[d196c070bbe03594]::plumbing::QueryCtxt, false>
  48:     0x784e5d852908 - rustc_query_impl[d196c070bbe03594]::query_impl::items_of_instance::get_query_non_incr::__rust_end_short_backtrace
  49:     0x784e5d855231 - rustc_monomorphize[a230bf6b05bd6360]::collector::collect_items_rec::{closure#0}
  50:     0x784e5d855f66 - rustc_monomorphize[a230bf6b05bd6360]::collector::collect_items_rec
  51:     0x784e5d856b78 - rustc_monomorphize[a230bf6b05bd6360]::collector::collect_items_rec
  52:     0x784e5d2c09e1 - rustc_monomorphize[a230bf6b05bd6360]::collector::collect_crate_mono_items::{closure#1}::{closure#0}
  53:     0x784e5d47eb27 - rustc_monomorphize[a230bf6b05bd6360]::partitioning::collect_and_partition_mono_items
  54:     0x784e5e0cc5d6 - rustc_query_impl[d196c070bbe03594]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d196c070bbe03594]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 40usize]>>
  55:     0x784e5e0cc5b9 - <rustc_query_impl[d196c070bbe03594]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[ce1fa00964895ff1]::ops::function::FnOnce<(rustc_middle[dca19e53efad7b1b]::ty::context::TyCtxt, ())>>::call_once
  56:     0x784e5e0cc0e9 - rustc_query_system[ff49814a586d4008]::query::plumbing::try_execute_query::<rustc_query_impl[d196c070bbe03594]::DynamicConfig<rustc_query_system[ff49814a586d4008]::query::caches::SingleCache<rustc_middle[dca19e53efad7b1b]::query::erase::Erased<[u8; 40usize]>>, false, false, false>, rustc_query_impl[d196c070bbe03594]::plumbing::QueryCtxt, false>
  57:     0x784e5e0cbe8b - rustc_query_impl[d196c070bbe03594]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace
  58:     0x784e5e02ae9e - <rustc_codegen_llvm[bf492ce4d6272450]::LlvmCodegenBackend as rustc_codegen_ssa[71734530e995220f]::traits::backend::CodegenBackend>::codegen_crate
  59:     0x784e5e03708d - <rustc_interface[4b2c44076e9c0aea]::queries::Linker>::codegen_and_build_linker
  60:     0x784e5e034c38 - rustc_interface[4b2c44076e9c0aea]::passes::create_and_enter_global_ctxt::<core[ce1fa00964895ff1]::option::Option<rustc_interface[4b2c44076e9c0aea]::queries::Linker>, rustc_driver_impl[d80da60e87609ad4]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  61:     0x784e5df0b5a6 - rustc_interface[4b2c44076e9c0aea]::interface::run_compiler::<(), rustc_driver_impl[d80da60e87609ad4]::run_compiler::{closure#0}>::{closure#1}
  62:     0x784e5dedad7e - std[e444442488e5ea2d]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[4b2c44076e9c0aea]::util::run_in_thread_with_globals<rustc_interface[4b2c44076e9c0aea]::util::run_in_thread_pool_with_globals<rustc_interface[4b2c44076e9c0aea]::interface::run_compiler<(), rustc_driver_impl[d80da60e87609ad4]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  63:     0x784e5dedb1f4 - <<std[e444442488e5ea2d]::thread::Builder>::spawn_unchecked_<rustc_interface[4b2c44076e9c0aea]::util::run_in_thread_with_globals<rustc_interface[4b2c44076e9c0aea]::util::run_in_thread_pool_with_globals<rustc_interface[4b2c44076e9c0aea]::interface::run_compiler<(), rustc_driver_impl[d80da60e87609ad4]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[ce1fa00964895ff1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  64:     0x784e5dedc5eb - std::sys::pal::unix::thread::Thread::new::thread_start::h8985427f793e6fe1
  65:     0x784e57ca370a - <unknown>
  66:     0x784e57d27aac - <unknown>
  67:                0x0 - <unknown>

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/matthias/vcs/github/CRED/rustc-ice-2025-05-09T18_48_23-1552552.txt` to your bug report

note: compiler flags: -Z mir-enable-passes=+DataflowConstProp

query stack during panic:
#0 [mir_shims] generating MIR shim for `core::future::async_drop::async_drop_in_place::{closure#0}`, instance=AsyncDropGlue(DefId(2:15259 ~ core[ce1f]::future::async_drop::async_drop_in_place::{closure#0}), Coroutine(DefId(2:15259 ~ core[ce1f]::future::async_drop::async_drop_in_place::{closure#0}), [c/#0, (), core::future::ResumeTy, (), (), CoroutineWitness(DefId(2:15259 ~ core[ce1f]::future::async_drop::async_drop_in_place::{closure#0}), [c/#0]), (*mut c/#0,)]))
#1 [layout_of] computing layout of `{async fn body of core::future::async_drop::async_drop_in_place<c>()}`
... and 4 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
error: aborting due to 1 previous error; 4 warnings emitted

@jieyouxu jieyouxu added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. labels May 10, 2025
@azhogin
Copy link
Contributor

azhogin commented May 10, 2025

Fix in progress: #140902

bors added a commit to rust-lang-ci/rust that referenced this issue May 11, 2025
…-for-adt-fix, r=oli-obk

Async drop fix for async_drop_in_place<T> layout for unspecified T

Fix for rust-lang#140423.
Layout of `async_drop_in_place<T>::{closure}` is calculated for unspecified T from dataflow_const_prop `try_make_constant`.

`@oli-obk,` do you think, it may be a better solution to add check like `if !args[0].is_fully_specialized() { return None; }` in `fn async_drop_coroutine_layout`?
And could you, pls, recommend, how to implement `is_fully_specialized()` in a most simple way?
github-actions bot pushed a commit to rust-lang/miri that referenced this issue May 12, 2025
…fix, r=oli-obk

Async drop fix for async_drop_in_place<T> layout for unspecified T

Fix for rust-lang/rust#140423.
Layout of `async_drop_in_place<T>::{closure}` is calculated for unspecified T from dataflow_const_prop `try_make_constant`.

`@oli-obk,` do you think, it may be a better solution to add check like `if !args[0].is_fully_specialized() { return None; }` in `fn async_drop_coroutine_layout`?
And could you, pls, recommend, how to implement `is_fully_specialized()` in a most simple way?
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) ❄️ 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.
Projects
None yet
Development

No branches or pull requests

7 participants