Skip to content

Commit a7bc0b9

Browse files
trans: Add missing normalize_associated_type() call to callee::get_fn().
1 parent 4a3f9b8 commit a7bc0b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_trans/callee.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
303303
let tcx = ccx.tcx();
304304

305305
// Normalize the type for better caching.
306-
let bare_fn_ty = tcx.erase_regions(&bare_fn_ty);
306+
let bare_fn_ty = tcx.normalize_associated_type(&bare_fn_ty);
307307

308308
// If this is an impl of `Fn` or `FnMut` trait, the receiver is `&self`.
309309
let is_by_ref = match closure_kind {
@@ -469,7 +469,7 @@ fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
469469
// Should be either intra-crate or inlined.
470470
assert_eq!(def_id.krate, LOCAL_CRATE);
471471

472-
let substs = tcx.mk_substs(substs.clone().erase_regions());
472+
let substs = tcx.normalize_associated_type(&substs);
473473
let (val, fn_ty) = monomorphize::monomorphic_fn(ccx, def_id, substs);
474474
let fn_ptr_ty = match fn_ty.sty {
475475
ty::TyFnDef(_, _, fty) => {

0 commit comments

Comments
 (0)