From 25eb3829e5661ab85067188ca9e6586c29aed6e9 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Tue, 8 Jul 2025 22:37:12 +0200 Subject: Error on moving unsized values rather than ICE'ing --- compiler/rustc_codegen_ssa/src/mir/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_ssa/src') diff --git a/compiler/rustc_codegen_ssa/src/mir/mod.rs b/compiler/rustc_codegen_ssa/src/mir/mod.rs index 4e35b143173..fa69820d5d2 100644 --- a/compiler/rustc_codegen_ssa/src/mir/mod.rs +++ b/compiler/rustc_codegen_ssa/src/mir/mod.rs @@ -141,7 +141,12 @@ enum LocalRef<'tcx, V> { /// `UnsizedPlace(p)`: `p` itself is a thin pointer (indirect place). /// `*p` is the wide pointer that references the actual unsized place. /// - /// Rust has no alloca and thus no ability to move the unsized place. + /// MIR only supports unsized args, not dynamically-sized locals, so + /// new unsized temps don't exist and we must reuse the referred-to place. + /// + /// FIXME: Since the removal of unsized locals in , + /// can we maybe use `Place` here? Or refactor it in another way? There are quite a few + /// `UnsizedPlace => bug` branches now. UnsizedPlace(PlaceRef<'tcx, V>), /// The backend [`OperandValue`] has already been generated. Operand(OperandRef<'tcx, V>), -- cgit 1.4.1-3-g733a5