diff --git a/src/base.rs b/src/base.rs index 8c19aba1404..5b0aea73a63 100644 --- a/src/base.rs +++ b/src/base.rs @@ -9,6 +9,10 @@ pub fn trans_mono_item<'a, 'tcx: 'a>(cx: &mut CodegenCx<'a, 'tcx, CurrentBackend def: InstanceDef::Item(def_id), substs, } => { + let mut mir = ::std::io::Cursor::new(Vec::new()); + ::rustc_mir::util::write_mir_pretty(tcx, Some(def_id), &mut mir).unwrap(); + tcx.sess.warn(&format!("{:?}:\n\n{}", def_id, String::from_utf8_lossy(&mir.into_inner()))); + let sig = tcx.fn_sig(def_id); let sig = cton_sig_from_fn_sig(tcx, sig, substs); let func_id = { @@ -23,10 +27,6 @@ pub fn trans_mono_item<'a, 'tcx: 'a>(cx: &mut CodegenCx<'a, 'tcx, CurrentBackend let mut f = Function::with_name_signature(ExternalName::user(0, func_id.index() as u32), sig); - let mut mir = ::std::io::Cursor::new(Vec::new()); - ::rustc_mir::util::write_mir_pretty(tcx, Some(def_id), &mut mir).unwrap(); - tcx.sess.warn(&format!("{:?}:\n\n{}", def_id, String::from_utf8_lossy(&mir.into_inner()))); - ::base::trans_fn(cx, &mut f, inst); let mut cton = String::new(); diff --git a/src/common.rs b/src/common.rs index eedd81d2efc..2be8bf83751 100644 --- a/src/common.rs +++ b/src/common.rs @@ -47,6 +47,7 @@ fn cton_type_from_ty(ty: Ty) -> Option { } TypeVariants::TyFnPtr(_) => types::I64, TypeVariants::TyRef(..) | TypeVariants::TyRawPtr(..) => types::I64, + TypeVariants::TyParam(_) => bug!("{:?}", ty), _ => return None, }) }