Skip to content

Commit 9c302f5

Browse files
committed
normalize in codegen_fulfill_obligations
1 parent 5296ac6 commit 9c302f5

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_trait_selection/src/traits/codegen

1 file changed

+4
-4
lines changed

compiler/rustc_trait_selection/src/traits/codegen/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ use rustc_middle::ty::{self, TyCtxt};
1919
/// obligations *could be* resolved if we wanted to.
2020
/// Assumes that this is run after the entire crate has been successfully type-checked.
2121
pub fn codegen_fulfill_obligation<'tcx>(
22-
ty: TyCtxt<'tcx>,
22+
tcx: TyCtxt<'tcx>,
2323
(param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>),
2424
) -> Result<ImplSource<'tcx, ()>, ErrorReported> {
25-
// Remove any references to regions; this helps improve caching.
26-
let trait_ref = ty.erase_regions(&trait_ref);
25+
// Remove any references to regions and normalize; this helps improve caching.
26+
let trait_ref = tcx.normalize_erasing_regions(param_env, trait_ref);
2727

2828
debug!(
2929
"codegen_fulfill_obligation(trait_ref={:?}, def_id={:?})",
@@ -33,7 +33,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
3333

3434
// Do the initial selection for the obligation. This yields the
3535
// shallow result we are looking for -- that is, what specific impl.
36-
ty.infer_ctxt().enter(|infcx| {
36+
tcx.infer_ctxt().enter(|infcx| {
3737
let mut selcx = SelectionContext::new(&infcx);
3838

3939
let obligation_cause = ObligationCause::dummy();

0 commit comments

Comments
 (0)