about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/mir/mod.rs
diff options
context:
space:
mode:
authormejrs <59372212+mejrs@users.noreply.github.com>2025-07-08 22:37:12 +0200
committermejrs <59372212+mejrs@users.noreply.github.com>2025-07-08 22:37:12 +0200
commit25eb3829e5661ab85067188ca9e6586c29aed6e9 (patch)
tree3ccb9a062c06d5e90c134b08b76b32082518b0e6 /compiler/rustc_codegen_ssa/src/mir/mod.rs
parent49421d1fa382fba84792e5d5dd7721c1c3e0e46e (diff)
downloadrust-25eb3829e5661ab85067188ca9e6586c29aed6e9.tar.gz
rust-25eb3829e5661ab85067188ca9e6586c29aed6e9.zip
Error on moving unsized values rather than ICE'ing
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/mir/mod.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/mod.rs7
1 files changed, 6 insertions, 1 deletions
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 <https://github.com/rust-lang/rust/pull/142911>,
+    /// 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>),