diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-09-28 20:56:52 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-10-07 09:50:30 +0200 |
| commit | 9c302f55bd07a04305dfa2bd815d2559deb8468f (patch) | |
| tree | 2d0511bf4f2ef7487c9192cce60da4ec0dc99966 /compiler/rustc_trait_selection/src/traits/codegen/mod.rs | |
| parent | 5296ac656504883ef3432694ac3c5f3033255641 (diff) | |
| download | rust-9c302f55bd07a04305dfa2bd815d2559deb8468f.tar.gz rust-9c302f55bd07a04305dfa2bd815d2559deb8468f.zip | |
normalize in codegen_fulfill_obligations
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/codegen/mod.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/codegen/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/codegen/mod.rs b/compiler/rustc_trait_selection/src/traits/codegen/mod.rs index dd7ea55cc10..753d64d6115 100644 --- a/compiler/rustc_trait_selection/src/traits/codegen/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/codegen/mod.rs @@ -19,11 +19,11 @@ use rustc_middle::ty::{self, TyCtxt}; /// obligations *could be* resolved if we wanted to. /// Assumes that this is run after the entire crate has been successfully type-checked. pub fn codegen_fulfill_obligation<'tcx>( - ty: TyCtxt<'tcx>, + tcx: TyCtxt<'tcx>, (param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>), ) -> Result<ImplSource<'tcx, ()>, ErrorReported> { - // Remove any references to regions; this helps improve caching. - let trait_ref = ty.erase_regions(&trait_ref); + // Remove any references to regions and normalize; this helps improve caching. + let trait_ref = tcx.normalize_erasing_regions(param_env, trait_ref); debug!( "codegen_fulfill_obligation(trait_ref={:?}, def_id={:?})", @@ -33,7 +33,7 @@ pub fn codegen_fulfill_obligation<'tcx>( // Do the initial selection for the obligation. This yields the // shallow result we are looking for -- that is, what specific impl. - ty.infer_ctxt().enter(|infcx| { + tcx.infer_ctxt().enter(|infcx| { let mut selcx = SelectionContext::new(&infcx); let obligation_cause = ObligationCause::dummy(); |
