From c118b17953a8e29b850b8ed8fe0d3aaf2917a9da Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 27 Dec 2018 14:25:05 +0100 Subject: [PATCH] use a better way to get at the type parameter --- src/librustc_codegen_ssa/mir/block.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index de824322263d..aa82c853257a 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -502,12 +502,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // emit a panic or a NOP for `panic_if_uninhabited` if intrinsic == Some("panic_if_uninhabited") { - let ty = match callee.layout.ty.sty { - ty::FnDef(_, substs) => { - substs.type_at(0) - } - _ => bug!("{} is not callable as intrinsic", callee.layout.ty) - }; + let ty = instance.unwrap().substs.type_at(0); let layout = bx.layout_of(ty); if layout.abi.is_uninhabited() { let loc = bx.sess().source_map().lookup_char_pos(span.lo());