Skip to content
Permalink
Browse files

Remove a ZST special casing that is not necessary anymore

  • Loading branch information
oli-obk committed Dec 21, 2019
1 parent cc0fbdf commit 5b770b080fab5a64875ffb10deff9e6d14950fc0
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/librustc_mir/interpret/validity.rs
@@ -596,15 +596,11 @@ impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
{
// Optimized handling for arrays of integer/float type.

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

0 comments on commit 5b770b0

Please sign in to comment.
You can’t perform that action at this time.