Skip to content

Commit 5b770b0

Browse files
committed
Remove a ZST special casing that is not necessary anymore
1 parent cc0fbdf commit 5b770b0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/librustc_mir/interpret/validity.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,11 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
596596
{
597597
// Optimized handling for arrays of integer/float type.
598598

599-
// bailing out for zsts is ok, since the array element type can only be int/float
600-
if op.layout.is_zst() {
601-
return Ok(());
602-
}
603-
// non-ZST array cannot be immediate, slices are never immediate
599+
// Arrays cannot be immediate, slices are never immediate.
604600
let mplace = op.assert_mem_place(self.ecx);
605601
// This is the length of the array/slice.
606602
let len = mplace.len(self.ecx)?;
607-
// zero length slices have nothing to be checked
603+
// Zero length slices have nothing to be checked.
608604
if len == 0 {
609605
return Ok(());
610606
}

0 commit comments

Comments
 (0)