stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: <rustc_mir_build::builder::Builder>::expr_as_place
4: <rustc_mir_build::builder::Builder>::expr_as_place
5: <rustc_mir_build::builder::Builder>::lower_scrutinee
6: <rustc_mir_build::builder::Builder>::ast_block_stmts
7: <rustc_mir_build::builder::Builder>::ast_block
8: <rustc_mir_build::builder::Builder>::expr_into_dest
9: <rustc_mir_build::builder::Builder>::expr_into_dest
10: rustc_mir_build::builder::build_mir_inner_impl
11: rustc_mir_transform::mir_built
12: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
13: rustc_mir_build::check_unsafety::check_unsafety
14: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 0]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
15: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
16: rustc_interface::passes::analysis
17: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
18: 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 `/playground/rustc-ice-2026-05-12T03_25_26-65.txt` to your bug report
note: rustc 1.97.0-nightly (4b0c9d76a 2026-05-10) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [mir_built] building MIR for `foo`
#1 [check_unsafety] unsafety-checking `foo`
#2 [analysis] running analysis passes on crate `playground`
end of query stack
error: could not compile `playground` (lib)
Code
Meta
Reproducible on the playground with version
1.97.0-nightly (2026-05-10 4b0c9d76ae7d387229ca)Error output
Backtrace
Relevant code:
rust/compiler/rustc_mir_build/src/builder/expr/as_place.rs
Lines 593 to 598 in aa31d6d