normalize in codegen_fulfill_obligations
This commit is contained in:
parent
5296ac6565
commit
9c302f55bd
1 changed files with 4 additions and 4 deletions
|
@ -19,11 +19,11 @@ use rustc_middle::ty::{self, TyCtxt};
|
||||||
/// obligations *could be* resolved if we wanted to.
|
/// obligations *could be* resolved if we wanted to.
|
||||||
/// Assumes that this is run after the entire crate has been successfully type-checked.
|
/// Assumes that this is run after the entire crate has been successfully type-checked.
|
||||||
pub fn codegen_fulfill_obligation<'tcx>(
|
pub fn codegen_fulfill_obligation<'tcx>(
|
||||||
ty: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
(param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>),
|
(param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>),
|
||||||
) -> Result<ImplSource<'tcx, ()>, ErrorReported> {
|
) -> Result<ImplSource<'tcx, ()>, ErrorReported> {
|
||||||
// Remove any references to regions; this helps improve caching.
|
// Remove any references to regions and normalize; this helps improve caching.
|
||||||
let trait_ref = ty.erase_regions(&trait_ref);
|
let trait_ref = tcx.normalize_erasing_regions(param_env, trait_ref);
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"codegen_fulfill_obligation(trait_ref={:?}, def_id={:?})",
|
"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
|
// Do the initial selection for the obligation. This yields the
|
||||||
// shallow result we are looking for -- that is, what specific impl.
|
// 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 mut selcx = SelectionContext::new(&infcx);
|
||||||
|
|
||||||
let obligation_cause = ObligationCause::dummy();
|
let obligation_cause = ObligationCause::dummy();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue