calling panic_if_uninhabited is not actually UB

This commit is contained in:
Ralf Jung
2019-11-03 15:39:03 +01:00
parent 4f7171585f
commit 955a26fb08
+2 -1
View File
@@ -381,7 +381,8 @@ fn call_intrinsic(
let ty = substs.type_at(0);
let layout = this.layout_of(ty)?;
if layout.abi.is_uninhabited() {
throw_ub_format!("Trying to instantiate uninhabited type {}", ty)
// FIXME: This should throw a panic in the interpreted program instead.
throw_unsup_format!("Trying to instantiate uninhabited type {}", ty)
}
}