@@ -11,7 +11,7 @@ use rustc_hir::intravisit;
11
11
use rustc_hir:: { GenericParamKind , ImplItemKind } ;
12
12
use rustc_infer:: infer:: outlives:: env:: OutlivesEnvironment ;
13
13
use rustc_infer:: infer:: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
14
- use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
14
+ use rustc_infer:: infer:: { self , DefiningAnchor , InferCtxt , TyCtxtInferExt } ;
15
15
use rustc_infer:: traits:: util;
16
16
use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
17
17
use rustc_middle:: ty:: util:: ExplicitSelf ;
@@ -203,7 +203,7 @@ fn compare_method_predicate_entailment<'tcx>(
203
203
let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
204
204
205
205
let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
206
- let ocx = ObligationCtxt :: new ( infcx) ;
206
+ let ocx = ObligationCtxt :: new ( infcx, DefiningAnchor :: Error ) ;
207
207
208
208
debug ! ( "compare_impl_method: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
209
209
@@ -619,7 +619,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
619
619
impl_to_placeholder_substs. rebase_onto ( tcx, impl_m. container_id ( tcx) , trait_to_impl_substs) ;
620
620
621
621
let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
622
- let ocx = ObligationCtxt :: new ( infcx) ;
622
+ let ocx = ObligationCtxt :: new ( infcx, DefiningAnchor :: Error ) ;
623
623
624
624
// Normalize the impl signature with fresh variables for lifetime inference.
625
625
let norm_cause = ObligationCause :: misc ( return_span, impl_m_def_id) ;
@@ -1652,7 +1652,7 @@ pub(super) fn compare_impl_const_raw(
1652
1652
1653
1653
let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1654
1654
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 ) ;
1656
1656
1657
1657
// The below is for the most part highly similar to the procedure
1658
1658
// for methods above. It is simpler in many respects, especially
@@ -1806,7 +1806,7 @@ fn compare_type_predicate_entailment<'tcx>(
1806
1806
) ;
1807
1807
let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
1808
1808
let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1809
- let ocx = ObligationCtxt :: new ( & infcx) ;
1809
+ let ocx = ObligationCtxt :: new ( & infcx, DefiningAnchor :: Error ) ;
1810
1810
1811
1811
debug ! ( "compare_type_predicate_entailment: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
1812
1812
@@ -1992,7 +1992,7 @@ pub(super) fn check_type_bounds<'tcx>(
1992
1992
let rebased_substs = impl_ty_substs. rebase_onto ( tcx, container_id, impl_trait_ref. substs ) ;
1993
1993
1994
1994
let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1995
- let ocx = ObligationCtxt :: new ( & infcx) ;
1995
+ let ocx = ObligationCtxt :: new ( & infcx, DefiningAnchor :: Error ) ;
1996
1996
1997
1997
let impl_ty_span = match tcx. hir ( ) . get_by_def_id ( impl_ty_def_id) {
1998
1998
hir:: Node :: TraitItem ( hir:: TraitItem {
0 commit comments