Skip to content

Commit c118b17

Browse files
committed
use a better way to get at the type parameter
1 parent fff905b commit c118b17

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustc_codegen_ssa/mir/block.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
502502

503503
// emit a panic or a NOP for `panic_if_uninhabited`
504504
if intrinsic == Some("panic_if_uninhabited") {
505-
let ty = match callee.layout.ty.sty {
506-
ty::FnDef(_, substs) => {
507-
substs.type_at(0)
508-
}
509-
_ => bug!("{} is not callable as intrinsic", callee.layout.ty)
510-
};
505+
let ty = instance.unwrap().substs.type_at(0);
511506
let layout = bx.layout_of(ty);
512507
if layout.abi.is_uninhabited() {
513508
let loc = bx.sess().source_map().lookup_char_pos(span.lo());

0 commit comments

Comments
 (0)