]> git.lizzy.rs Git - rust.git/commitdiff
calling panic_if_uninhabited is not actually UB
authorRalf Jung <post@ralfj.de>
Sun, 3 Nov 2019 14:39:03 +0000 (15:39 +0100)
committerRalf Jung <post@ralfj.de>
Sun, 3 Nov 2019 14:39:03 +0000 (15:39 +0100)
src/shims/intrinsics.rs

index cdd31c9298c4e1bcfd8d9aa5963c4fdfe158f036..7c8c06cbbfd54171f6ffc502c0bbd8635f341473 100644 (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)
                 }
             }