about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2019-12-22 00:33:15 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-07 15:41:47 +0100
commit5b770b080fab5a64875ffb10deff9e6d14950fc0 (patch)
tree805e00cc07ea2a89a909f089918d4d7bd7551741 /src
parentcc0fbdffe7db21649f45b3407ff9766636727690 (diff)
downloadrust-5b770b080fab5a64875ffb10deff9e6d14950fc0.tar.gz
rust-5b770b080fab5a64875ffb10deff9e6d14950fc0.zip
Remove a ZST special casing that is not necessary anymore
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/interpret/validity.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs
index 73f479ede76..78690973153 100644
--- a/src/librustc_mir/interpret/validity.rs
+++ b/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(());
                 }