[ICE]: could not resolve upvar: LocalVarId(HirId(DefId(
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
auto-reduced (treereduce-rust):
//@compile-flags: --edition=2024
#![feature(pin_ergonomics)]
use core::pin::{pin, Pin};
use core::task::{Context, Poll, Waker};
fn test_idempotency<T>(mut x: Pin<&mut T>) -> impl Future + '_
where
T: Future<Output = ()>,
{
core::future::poll_fn(move |cx| {
assert_eq!(x.as_mut().poll(cx), Poll::Ready(()));
Poll::Ready(())
})
}
original code
original:
//@ run-pass
//@ check-run-results
// WARNING: If you would ever want to modify this test,
// please consider modifying miri's async drop test at
// `src/tools/miri/tests/pass/async-drop.rs`.
#![feature(async_drop)]
#![allow(incomplete_features, dead_code)]
//@ edition: 2021
// FIXME(zetanumbers): consider AsyncDestruct::async_drop cleanup tests
use core::future::{async_drop_in_place, AsyncDrop, Future};
use core::hint::black_box;
use core::mem::{self, ManuallyDrop};
use core::pin::{pin, Pin};
use core::task::{Context, Poll, Waker};
async fn test_async_drop<T>(x: T, _size: usize) {
let mut x = mem::MaybeUninit::new(x);
let dtor = pin!(unsafe { async_drop_in_place(x.as_mut_ptr()) });
// FIXME(zetanumbers): This check fully depends on the layout of
// the coroutine state, since async destructor combinators are just
// async functions.
#[cfg(target_pointer_width = "64")]
assert_eq!(
mem::size_of_val(&*dtor),
_size,
"sizes did not match for async destructor of type {}",
core::any::type_name::<T>(),
);
test_idempotency(dtor).await;
}
fn test_idempotency<T>(mut x: Pin<&mut T>) -> impl Future<Output = ()> + '_
where
T: Future<Output = ()>,
{
core::future::poll_fn(move |cx| {
assert_eq!(x.as_mut().poll(cx), Poll::Ready(()));
assert_eq!(x.as_mut().poll(cx), Poll::Ready(()));
Poll::Ready(())
})
}
fn main() {
let waker = Waker::noop();
let mut cx = Context::from_waker(&waker);
let i = 13;
let fut = pin!(async {
test_async_drop(Int(0), 16).await;
test_async_drop(AsyncInt(0), 32).await;
test_async_drop([AsyncInt(1), AsyncInt(2)], 104).await;
test_async_drop((AsyncInt(3), AsyncInt(4)), 120).await;
test_async_drop(5, 16).await;
let j = 42;
test_async_drop(&i, 16).await;
test_async_drop(&j, 16).await;
test_async_drop(
AsyncStruct { b: AsyncInt(8), a: AsyncInt(7), i: 6 },
136,
).await;
test_async_drop(ManuallyDrop::new(AsyncInt(9)), 16).await;
let foo = AsyncInt(10);
test_async_drop(AsyncReference { foo: &foo }, 32).await;
let _ = ManuallyDrop::new(foo);
let foo = AsyncInt(11);
test_async_drop(
|| {
black_box(foo);
let foo = AsyncInt(10);
foo
},
48,
)
.await;
test_async_drop(AsyncEnum::A(AsyncInt(12)), 104).await;
test_async_drop(AsyncEnum::B(SyncInt(13)), 104).await;
test_async_drop(SyncInt(14), 16).await;
test_async_drop(
SyncThenAsync { i: 15, a: AsyncInt(16), b: SyncInt(17), c: AsyncInt(18) },
120,
)
.await;
let mut ptr19 = mem::MaybeUninit::new(AsyncInt(19));
let async_drop_fut = pin!(unsafe { async_drop_in_place(ptr19.as_mut_ptr()) });
test_idempotency(async_drop_fut).await;
let foo = AsyncInt(20);
test_async_drop(
async || {
black_box(foo);
let foo = AsyncInt(19);
// Await point there, but this is async closure so it's fine
black_box(core::future::ready(())).await;
foo
},
48,
)
.await;
test_async_drop(AsyncUnion { signed: 21 }, 32).await;
});
let res = fut.poll(&mut cx);
assert_eq!(res, Poll::Ready(()));
}
struct AsyncInt(i32);
impl Drop for AsyncInt {
fn drop(&mut self) {
println!("AsyncInt::drop: {}", self.0);
}
}
impl AsyncDrop for AsyncInt {
async fn drop(self: Pin<&mut Self>) {
println!("AsyncInt::Dropper::poll: {}", self.0);
}
}
struct SyncInt(i32);
impl Drop for SyncInt {
fn drop(&mut self) {
println!("SyncInt::drop: {}", self.0);
}
}
struct SyncThenAsync {
i: i32,
a: AsyncInt,
b: SyncInt,
c: AsyncInt,
}
impl Drop for SyncThenAsync {
fn drop(&mut self) {
println!("SyncThenAsync::drop: {}", self.i);
}
}
struct AsyncReference<'a> {
foo: &'a AsyncInt,
}
impl Drop for AsyncReference<'_> {
fn drop(&mut self) {
println!("AsyncReference::drop: {}", self.foo.0);
}
}
impl AsyncDrop for AsyncReference<'_> {
async fn drop(self: Pin<&mut Self>) {
println!("AsyncReference::Dropper::poll: {}", self.foo.0);
}
}
struct Int(i32);
struct AsyncStruct {
i: i32,
a: AsyncInt,
b: AsyncInt,
}
impl Drop for AsyncStruct {
fn drop(&mut self) {
println!("AsyncStruct::drop: {}", self.i);
}
}
impl AsyncDrop for AsyncStruct {
async fn drop(self: Pin<&mut Self>) {
println!("AsyncStruct::Dropper::poll: {}", self.i);
}
}
enum AsyncEnum {
A(i32),
B(SyncInt),
}
impl Drop for AsyncEnum {
fn drop(&mut self) {
let new_self = match self {
AsyncEnum::A(foo) => {
println!("AsyncEnum(A)::drop: {}", foo.0);
AsyncEnum::B(SyncInt(foo.0))
}
AsyncEnum::B(foo) => {
println!("AsyncEnum(B)::drop: {}", foo.0);
AsyncEnum::A(AsyncInt(foo.0))
}
};
mem::forget(mem::replace(&mut *self, new_self));
}
}
impl AsyncDrop for AsyncEnum {
async fn drop(mut self: Pin<&mut Self>) {
let new_self = match &*self {
AsyncEnum::A(foo) => {
println!("AsyncEnum(A)::Dropper::poll: {}", foo.0);
AsyncEnum::B(SyncInt(foo.0))
}
AsyncEnum::B(foo) => {
println!("AsyncEnum(B)::Dropper::poll: {}", foo.0);
AsyncEnum::A(AsyncInt(foo.0))
}
};
mem::forget(mem::replace(&mut *self, new_self));
}
}
// FIXME(zetanumbers): Disallow types with `AsyncDrop` in unions
union AsyncUnion {
signed: i32,
unsigned: u32,
}
impl Drop for AsyncUnion {
fn drop(&mut self) {
println!(
"AsyncUnion::drop: {}, {}",
unsafe { self.signed },
unsafe { self.unsigned },
);
}
}
impl AsyncDrop for AsyncUnion {
async fn drop(self: Pin<&mut Self>) {
println!(
"AsyncUnion::Dropper::poll: {}, {}",
unsafe { self.signed },
unsafe { self.unsigned },
);
}
}
Version information
rustc 1.96.0-nightly (2972b5e59 2026-04-03)
binary: rustc
commit-hash: 2972b5e59f1c5529b6ba770437812fd83ab4ebd4
commit-date: 2026-04-03
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2
Possibly related line of code:
https://github.com/rust-lang/rust/blob/2972b5e59f1c5529b6ba770437812fd83ab4ebd4/compiler/rustc_mir_build/src/builder/expr/as_place.rs#L257-L269
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --edition=2024 -Zcrate-attr=feature(pin_ergonomics)
Program output
warning: the feature `pin_ergonomics` is incomplete and may not be safe to use and/or cause compiler crashes
--> <crate attribute>:1:12
|
1 | #![feature(pin_ergonomics)]
| ^^^^^^^^^^^^^^
|
= note: see issue #130494 <https://github.com/rust-lang/rust/issues/130494> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: unused import: `pin`
--> /tmp/icemaker_global_tempdir.eRddSEzN1izY/rustc_testrunner_tmpdir_reporting.mteWNf6k9IrD/mvce.rs:1:17
|
1 | use core::pin::{pin, Pin};
| ^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
warning: unused imports: `Context` and `Waker`
--> /tmp/icemaker_global_tempdir.eRddSEzN1izY/rustc_testrunner_tmpdir_reporting.mteWNf6k9IrD/mvce.rs:2:18
|
2 | use core::task::{Context, Poll, Waker};
| ^^^^^^^ ^^^^^
error[E0601]: `main` function not found in crate `mvce`
--> /tmp/icemaker_global_tempdir.eRddSEzN1izY/rustc_testrunner_tmpdir_reporting.mteWNf6k9IrD/mvce.rs:13:2
|
13 | }
| ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.eRddSEzN1izY/rustc_testrunner_tmpdir_reporting.mteWNf6k9IrD/mvce.rs`
error: internal compiler error: /rustc-dev/2972b5e59f1c5529b6ba770437812fd83ab4ebd4/compiler/rustc_mir_build/src/builder/expr/as_place.rs:263:67: could not resolve upvar: LocalVarId(HirId(DefId(0:10 ~ mvce[f0d2]::test_idempotency).2)) + []
--> /tmp/icemaker_global_tempdir.eRddSEzN1izY/rustc_testrunner_tmpdir_reporting.mteWNf6k9IrD/mvce.rs:4:24
|
4 | fn test_idempotency<T>(mut x: Pin<&mut T>) -> impl Future + '_
| ^^^^^
thread 'rustc' (2745198) panicked at /rustc-dev/2972b5e59f1c5529b6ba770437812fd83ab4ebd4/compiler/rustc_mir_build/src/builder/expr/as_place.rs:263:67:
Box<dyn Any>
stack backtrace:
0: 0x7f0aaffc0abb - <<std[de416e893de1faf9]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[9f8d6771964fc20c]::fmt::Display>::fmt
1: 0x7f0ab061e1c8 - core[9f8d6771964fc20c]::fmt::write
2: 0x7f0aaffd7ac6 - <std[de416e893de1faf9]::sys::stdio::unix::Stderr as std[de416e893de1faf9]::io::Write>::write_fmt
3: 0x7f0aaff96ac8 - std[de416e893de1faf9]::panicking::default_hook::{closure#0}
4: 0x7f0aaffb3ec3 - std[de416e893de1faf9]::panicking::default_hook
5: 0x7f0aaefc2e4c - std[de416e893de1faf9]::panicking::update_hook::<alloc[57804382fb016052]::boxed::Box<rustc_driver_impl[7a9a631d48bc4eca]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f0aaffb41a2 - std[de416e893de1faf9]::panicking::panic_with_hook
7: 0x7f0aaeff2e01 - std[de416e893de1faf9]::panicking::begin_panic::<rustc_errors[e123dae814032ce5]::ExplicitBug>::{closure#0}
8: 0x7f0aaefeb976 - std[de416e893de1faf9]::sys::backtrace::__rust_end_short_backtrace::<std[de416e893de1faf9]::panicking::begin_panic<rustc_errors[e123dae814032ce5]::ExplicitBug>::{closure#0}, !>
9: 0x7f0aaefeb84b - std[de416e893de1faf9]::panicking::begin_panic::<rustc_errors[e123dae814032ce5]::ExplicitBug>
10: 0x7f0aaeffe441 - <rustc_errors[e123dae814032ce5]::diagnostic::BugAbort as rustc_errors[e123dae814032ce5]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
11: 0x7f0aaf5acbdc - <rustc_errors[e123dae814032ce5]::DiagCtxtHandle>::span_bug::<rustc_span[ae25d23050d7877d]::span_encoding::Span, alloc[57804382fb016052]::string::String>
12: 0x7f0aaf5d4ad6 - rustc_middle[4d5ddcd23ba200cb]::util::bug::opt_span_bug_fmt::<rustc_span[ae25d23050d7877d]::span_encoding::Span>::{closure#0}
13: 0x7f0aaf5d4c82 - rustc_middle[4d5ddcd23ba200cb]::ty::context::tls::with_opt::<rustc_middle[4d5ddcd23ba200cb]::util::bug::opt_span_bug_fmt<rustc_span[ae25d23050d7877d]::span_encoding::Span>::{closure#0}, !>::{closure#0}
14: 0x7f0aaf5c523b - rustc_middle[4d5ddcd23ba200cb]::ty::context::tls::with_context_opt::<rustc_middle[4d5ddcd23ba200cb]::ty::context::tls::with_opt<rustc_middle[4d5ddcd23ba200cb]::util::bug::opt_span_bug_fmt<rustc_span[ae25d23050d7877d]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
15: 0x7f0aad6cdb18 - rustc_middle[4d5ddcd23ba200cb]::util::bug::span_bug_fmt::<rustc_span[ae25d23050d7877d]::span_encoding::Span>
16: 0x7f0ab0f36324 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
17: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
18: 0x7f0ab06674d4 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_operand
19: 0x7f0ab066ae54 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_call_operand
20: 0x7f0ab066b345 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_call_operand
21: 0x7f0ab0f2ed01 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
22: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
23: 0x7f0ab11cf5f8 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
24: 0x7f0ab11cfc8b - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
25: 0x7f0ab11ce68f - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
26: 0x7f0ab0f2f4aa - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
27: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
28: 0x7f0ab06674d4 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_operand
29: 0x7f0ab0f2fb63 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
30: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
31: 0x7f0ab06674d4 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_operand
32: 0x7f0ab066ae54 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_call_operand
33: 0x7f0ab066b345 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_call_operand
34: 0x7f0ab0f2ed01 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
35: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
36: 0x7f0ab11cf5f8 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
37: 0x7f0ab11cec73 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
38: 0x7f0ab0f2e16f - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
39: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
40: 0x7f0ab06674d4 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_operand
41: 0x7f0ab0667c17 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_operand
42: 0x7f0ab0669731 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_rvalue
43: 0x7f0ab0f2d9d4 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
44: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
45: 0x7f0ab11cf5f8 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
46: 0x7f0ab11cec73 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_as_place
47: 0x7f0ab0f30d8c - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
48: 0x7f0ab06640d3 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::as_temp::{closure#0}
49: 0x7f0ab0f1eded - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::stmt_expr
50: 0x7f0ab0f1ecb7 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::stmt_expr
51: 0x7f0ab15cacda - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::ast_block_stmts
52: 0x7f0ab15ca121 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::ast_block
53: 0x7f0ab0f2f57f - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
54: 0x7f0ab0f2e588 - <rustc_mir_build[26ffb09657e2f599]::builder::Builder>::expr_into_dest
55: 0x7f0ab0f139bb - rustc_mir_build[26ffb09657e2f599]::builder::build_mir_inner_impl
56: 0x7f0ab060b7f4 - rustc_mir_transform[1f6f3f6d4bd047c6]::mir_built
57: 0x7f0ab06bb866 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_data_structures[3e48709548f32bc4]::vec_cache::VecCache<rustc_span[ae25d23050d7877d]::def_id::LocalDefId, rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[4d5ddcd23ba200cb]::dep_graph::graph::DepNodeIndex>, false>
58: 0x7f0ab06bb383 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::mir_built::execute_query_non_incr::__rust_end_short_backtrace
59: 0x7f0ab062862f - rustc_mir_transform[1f6f3f6d4bd047c6]::ffi_unwind_calls::has_ffi_unwind_calls
60: 0x7f0ab0628099 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::has_ffi_unwind_calls::invoke_provider_fn::__rust_begin_short_backtrace
61: 0x7f0ab13891a4 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_data_structures[3e48709548f32bc4]::vec_cache::VecCache<rustc_span[ae25d23050d7877d]::def_id::LocalDefId, rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[4d5ddcd23ba200cb]::dep_graph::graph::DepNodeIndex>, false>
62: 0x7f0ab1388d76 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::has_ffi_unwind_calls::execute_query_non_incr::__rust_end_short_backtrace
63: 0x7f0ab108cf2a - rustc_mir_transform[1f6f3f6d4bd047c6]::mir_promoted
64: 0x7f0ab108cd92 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::mir_promoted::invoke_provider_fn::__rust_begin_short_backtrace
65: 0x7f0ab0e20737 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_data_structures[3e48709548f32bc4]::vec_cache::VecCache<rustc_span[ae25d23050d7877d]::def_id::LocalDefId, rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 16usize]>, rustc_middle[4d5ddcd23ba200cb]::dep_graph::graph::DepNodeIndex>, false>
66: 0x7f0ab0e202c3 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::mir_promoted::execute_query_non_incr::__rust_end_short_backtrace
67: 0x7f0ab13ab032 - <rustc_borrowck[c4b945395fabc085]::root_cx::BorrowCheckRootCtxt>::do_mir_borrowck
68: 0x7f0ab13a4eaf - rustc_borrowck[c4b945395fabc085]::mir_borrowck
69: 0x7f0ab13a4cf7 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::mir_borrowck::invoke_provider_fn::__rust_begin_short_backtrace
70: 0x7f0ab06bb866 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_data_structures[3e48709548f32bc4]::vec_cache::VecCache<rustc_span[ae25d23050d7877d]::def_id::LocalDefId, rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[4d5ddcd23ba200cb]::dep_graph::graph::DepNodeIndex>, false>
71: 0x7f0ab06b8f43 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::mir_borrowck::execute_query_non_incr::__rust_end_short_backtrace
72: 0x7f0ab1787e26 - rustc_hir_analysis[ffc1d045f4785174]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
73: 0x7f0ab1787b66 - rustc_hir_analysis[ffc1d045f4785174]::collect::type_of::type_of_opaque
74: 0x7f0ab065f00a - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_middle[4d5ddcd23ba200cb]::query::caches::DefIdCache<rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 8usize]>>, false>
75: 0x7f0ab0d83bce - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::type_of_opaque::execute_query_non_incr::__rust_end_short_backtrace
76: 0x7f0ab0d90314 - rustc_hir_analysis[ffc1d045f4785174]::collect::type_of::type_of
77: 0x7f0ab083b9e6 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::type_of::invoke_provider_fn::__rust_begin_short_backtrace
78: 0x7f0ab065f00a - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_middle[4d5ddcd23ba200cb]::query::caches::DefIdCache<rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 8usize]>>, false>
79: 0x7f0ab065eb90 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::type_of::execute_query_non_incr::__rust_end_short_backtrace
80: 0x7f0ab1788510 - rustc_hir_analysis[ffc1d045f4785174]::check::check::check_opaque
81: 0x7f0ab1392aa1 - rustc_hir_analysis[ffc1d045f4785174]::check::check::check_item_type
82: 0x7f0ab1389b9c - rustc_hir_analysis[ffc1d045f4785174]::check::wfcheck::check_well_formed
83: 0x7f0ab1389b6f - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
84: 0x7f0ab13891a4 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_data_structures[3e48709548f32bc4]::vec_cache::VecCache<rustc_span[ae25d23050d7877d]::def_id::LocalDefId, rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[4d5ddcd23ba200cb]::dep_graph::graph::DepNodeIndex>, false>
85: 0x7f0ab1388f3b - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
86: 0x7f0ab1385570 - rustc_hir_analysis[ffc1d045f4785174]::check::wfcheck::check_type_wf
87: 0x7f0ab13853e7 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
88: 0x7f0ab1802950 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_middle[4d5ddcd23ba200cb]::query::caches::SingleCache<rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 1usize]>>, false>
89: 0x7f0ab1802729 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
90: 0x7f0ab0f06ddb - rustc_hir_analysis[ffc1d045f4785174]::check_crate
91: 0x7f0ab06b7f61 - rustc_interface[e1d24a92004beaf7]::passes::analysis
92: 0x7f0ab1805049 - rustc_query_impl[fdd9a9cd73aeb4]::execution::try_execute_query::<rustc_middle[4d5ddcd23ba200cb]::query::caches::SingleCache<rustc_middle[4d5ddcd23ba200cb]::query::erase::ErasedData<[u8; 0usize]>>, false>
93: 0x7f0ab1804cb5 - rustc_query_impl[fdd9a9cd73aeb4]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
94: 0x7f0ab17b1990 - rustc_interface[e1d24a92004beaf7]::interface::run_compiler::<(), rustc_driver_impl[7a9a631d48bc4eca]::run_compiler::{closure#0}>::{closure#1}
95: 0x7f0ab17e3c3e - std[de416e893de1faf9]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e1d24a92004beaf7]::util::run_in_thread_with_globals<rustc_interface[e1d24a92004beaf7]::util::run_in_thread_pool_with_globals<rustc_interface[e1d24a92004beaf7]::interface::run_compiler<(), rustc_driver_impl[7a9a631d48bc4eca]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
96: 0x7f0ab17e44e0 - <std[de416e893de1faf9]::thread::lifecycle::spawn_unchecked<rustc_interface[e1d24a92004beaf7]::util::run_in_thread_with_globals<rustc_interface[e1d24a92004beaf7]::util::run_in_thread_pool_with_globals<rustc_interface[e1d24a92004beaf7]::interface::run_compiler<(), rustc_driver_impl[7a9a631d48bc4eca]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[9f8d6771964fc20c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
97: 0x7f0ab17e53ec - <std[de416e893de1faf9]::sys::thread::unix::Thread>::new::thread_start
98: 0x7f0aab2a597a - <unknown>
99: 0x7f0aab3292bc - <unknown>
100: 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: rustc 1.96.0-nightly (2972b5e59 2026-04-03) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z crate-attr=feature(pin_ergonomics) -Z dump-mir-dir=dir
query stack during panic:
#0 [mir_built] building MIR for `test_idempotency::{closure#0}`
#1 [has_ffi_unwind_calls] checking if `test_idempotency::{closure#0}` contains FFI-unwind calls
#2 [mir_promoted] promoting constants in MIR for `test_idempotency::{closure#0}`
#3 [mir_borrowck] borrow-checking `test_idempotency`
#4 [type_of_opaque] computing type of opaque `test_idempotency::{opaque#0}`
#5 [type_of] computing type of `test_idempotency::{opaque#0}`
#6 [check_well_formed] checking that `test_idempotency::{opaque#0}` is well-formed
#7 [check_type_wf] checking that types are well-formed
#8 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 2 previous errors; 3 warnings emitted
For more information about this error, try `rustc --explain E0601`.
@rustbot label +F-async_drop +F-pin_ergonomics
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reduced reproduction in a.rs and reproduce it using the reported rustc command with edition 2024 and pin_ergonomics enabled. Then inspect compiler/rustc_mir_build/src/builder/expr/as_place.rs around lines 257-269, which the issue identifies as the ICE location. Done means the reproduction no longer triggers the internal compiler error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100