@@ -96,7 +96,7 @@ pub fn overlapping_impls(
9696 }
9797
9898 let infcx = tcx. infer_ctxt ( ) . intercrate ( ) . build ( ) ;
99- let selcx = & mut SelectionContext :: new ( & infcx) ;
99+ let selcx = & mut SelectionContext :: new ( & infcx, DefiningAnchor :: Error ) ;
100100 let overlaps =
101101 overlap ( selcx, skip_leak_check, impl1_def_id, impl2_def_id, overlap_mode) . is_some ( ) ;
102102 if !overlaps {
@@ -107,7 +107,7 @@ pub fn overlapping_impls(
107107 // this time tracking intercrate ambiguity causes for better
108108 // diagnostics. (These take time and can lead to false errors.)
109109 let infcx = tcx. infer_ctxt ( ) . intercrate ( ) . build ( ) ;
110- let selcx = & mut SelectionContext :: new ( & infcx) ;
110+ let selcx = & mut SelectionContext :: new ( & infcx, DefiningAnchor :: Error ) ;
111111 selcx. enable_tracking_intercrate_ambiguity_causes ( ) ;
112112 Some ( overlap ( selcx, skip_leak_check, impl1_def_id, impl2_def_id, overlap_mode) . unwrap ( ) )
113113}
@@ -305,7 +305,7 @@ fn negative_impl(tcx: TyCtxt<'_>, impl1_def_id: DefId, impl2_def_id: DefId) -> b
305305 } ;
306306
307307 // Attempt to prove that impl2 applies, given all of the above.
308- let selcx = & mut SelectionContext :: new ( & infcx) ;
308+ let selcx = & mut SelectionContext :: new ( & infcx, DefiningAnchor :: Error ) ;
309309 let impl2_substs = infcx. fresh_substs_for_item ( DUMMY_SP , impl2_def_id) ;
310310 let ( subject2, obligations) =
311311 impl_subject_and_oblig ( selcx, impl_env, impl2_def_id, impl2_substs) ;
0 commit comments