mir: Improve size_of handling when arg is unsized
This commit is contained in:
parent
a243ad280a
commit
e3faeb486a
3 changed files with 35 additions and 3 deletions
|
@ -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)?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue