Skip to content

Commit f900333

Browse files
committed
Make sure the type we think is uninhabited actually is
1 parent 05067cf commit f900333

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_codegen_llvm/mir/block.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
430430
if intrinsic == Some("transmute") {
431431
if let Some(destination_ref) = destination.as_ref() {
432432
let &(ref dest, target) = destination_ref;
433-
self.trans_transmute(&bx, &args[0], dest);
433+
self.codegen_transmute(&bx, &args[0], dest);
434434
funclet_br(self, bx, target);
435435
} else {
436436
// If we are trying to transmute to an uninhabited type,
@@ -439,6 +439,7 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
439439
// we can do what we like. Here, we declare that transmuting
440440
// into an uninhabited type is impossible, so anything following
441441
// it must be unreachable.
442+
assert_eq!(bx.cx.layout_of(sig.output()).abi, layout::Abi::Uninhabited);
442443
bx.unreachable();
443444
}
444445
return;

0 commit comments

Comments
 (0)