about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/interpret
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2021-01-21 20:10:40 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2021-01-21 22:17:05 +0300
commite3faeb486a962d19e1f533a206511b669aced988 (patch)
treed0564b99aedb435e490b119845ed5b6a34776a2d /compiler/rustc_mir/src/interpret
parenta243ad280a4ac57c1b8427e30e31c5b505cf10de (diff)
downloadrust-e3faeb486a962d19e1f533a206511b669aced988.tar.gz
rust-e3faeb486a962d19e1f533a206511b669aced988.zip
mir: Improve size_of handling when arg is unsized
Diffstat (limited to 'compiler/rustc_mir/src/interpret')
-rw-r--r--compiler/rustc_mir/src/interpret/step.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_mir/src/interpret/step.rs b/compiler/rustc_mir/src/interpret/step.rs
index 6d447acbecf..fbc72ad8adc 100644
--- a/compiler/rustc_mir/src/interpret/step.rs
+++ b/compiler/rustc_mir/src/interpret/step.rs
@@ -270,6 +270,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                         self.frame().current_span(),
                         &format!("SizeOf nullary MIR operator called for unsized type {}", ty),
                     );
+                    throw_inval!(SizeOfUnsizedType(ty));
                 }
                 self.write_scalar(Scalar::from_machine_usize(layout.size.bytes(), self), dest)?;
             }