Skip to content

Commit

Permalink
use a better way to get at the type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 27, 2018
1 parent fff905b commit c118b17
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/librustc_codegen_ssa/mir/block.rs
Expand Up @@ -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());
Expand Down

0 comments on commit c118b17

Please sign in to comment.