@@ -11,7 +11,7 @@ use rustc_hir::intravisit;
1111use rustc_hir:: { GenericParamKind , ImplItemKind } ;
1212use rustc_infer:: infer:: outlives:: env:: OutlivesEnvironment ;
1313use rustc_infer:: infer:: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
14- use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
14+ use rustc_infer:: infer:: { self , DefiningAnchor , InferCtxt , TyCtxtInferExt } ;
1515use rustc_infer:: traits:: util;
1616use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
1717use rustc_middle:: ty:: util:: ExplicitSelf ;
@@ -203,7 +203,7 @@ fn compare_method_predicate_entailment<'tcx>(
203203 let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
204204
205205 let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
206- let ocx = ObligationCtxt :: new ( infcx) ;
206+ let ocx = ObligationCtxt :: new ( infcx, DefiningAnchor :: Error ) ;
207207
208208 debug ! ( "compare_impl_method: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
209209
@@ -619,7 +619,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
619619 impl_to_placeholder_substs. rebase_onto ( tcx, impl_m. container_id ( tcx) , trait_to_impl_substs) ;
620620
621621 let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
622- let ocx = ObligationCtxt :: new ( infcx) ;
622+ let ocx = ObligationCtxt :: new ( infcx, DefiningAnchor :: Error ) ;
623623
624624 // Normalize the impl signature with fresh variables for lifetime inference.
625625 let norm_cause = ObligationCause :: misc ( return_span, impl_m_def_id) ;
@@ -1652,7 +1652,7 @@ pub(super) fn compare_impl_const_raw(
16521652
16531653 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
16541654 let param_env = tcx. param_env ( impl_const_item_def. to_def_id ( ) ) ;
1655- let ocx = ObligationCtxt :: new ( & infcx) ;
1655+ let ocx = ObligationCtxt :: new ( & infcx, DefiningAnchor :: Error ) ;
16561656
16571657 // The below is for the most part highly similar to the procedure
16581658 // for methods above. It is simpler in many respects, especially
@@ -1806,7 +1806,7 @@ fn compare_type_predicate_entailment<'tcx>(
18061806 ) ;
18071807 let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
18081808 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1809- let ocx = ObligationCtxt :: new ( & infcx) ;
1809+ let ocx = ObligationCtxt :: new ( & infcx, DefiningAnchor :: Error ) ;
18101810
18111811 debug ! ( "compare_type_predicate_entailment: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
18121812
@@ -1992,7 +1992,7 @@ pub(super) fn check_type_bounds<'tcx>(
19921992 let rebased_substs = impl_ty_substs. rebase_onto ( tcx, container_id, impl_trait_ref. substs ) ;
19931993
19941994 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1995- let ocx = ObligationCtxt :: new ( & infcx) ;
1995+ let ocx = ObligationCtxt :: new ( & infcx, DefiningAnchor :: Error ) ;
19961996
19971997 let impl_ty_span = match tcx. hir ( ) . get_by_def_id ( impl_ty_def_id) {
19981998 hir:: Node :: TraitItem ( hir:: TraitItem {
0 commit comments