Error on moving unsized values rather than ICE'ing

This commit is contained in:
mejrs
2025-07-08 22:37:12 +02:00
parent 49421d1fa3
commit 25eb3829e5
8 changed files with 153 additions and 9 deletions

View File

@@ -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>),