about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2016-06-07 21:12:40 -0400
committerMichael Woerister <michaelwoerister@posteo.net>2016-07-08 10:42:48 -0400
commita7bc0b920f27f943bb841f3ace093a5449394497 (patch)
tree58a8edae179cc947af561eb5339337cd69ba9869
parent4a3f9b8962fb3946f155a39c745297e8e3126b05 (diff)
trans: Add missing normalize_associated_type() call to callee::get_fn().
-rw-r--r--src/librustc_trans/callee.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_trans/callee.rs b/src/librustc_trans/callee.rs
index c4a5a1864f6..983ee564c35 100644
--- a/src/librustc_trans/callee.rs
+++ b/src/librustc_trans/callee.rs
@@ -303,7 +303,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
     let tcx = ccx.tcx();
 
     // Normalize the type for better caching.
-    let bare_fn_ty = tcx.erase_regions(&bare_fn_ty);
+    let bare_fn_ty = tcx.normalize_associated_type(&bare_fn_ty);
 
     // If this is an impl of `Fn` or `FnMut` trait, the receiver is `&self`.
     let is_by_ref = match closure_kind {
@@ -469,7 +469,7 @@ fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
         // Should be either intra-crate or inlined.
         assert_eq!(def_id.krate, LOCAL_CRATE);
 
-        let substs = tcx.mk_substs(substs.clone().erase_regions());
+        let substs = tcx.normalize_associated_type(&substs);
         let (val, fn_ty) = monomorphize::monomorphic_fn(ccx, def_id, substs);
         let fn_ptr_ty = match fn_ty.sty {
             ty::TyFnDef(_, _, fty) => {