@@ -206,14 +206,19 @@ fn overlap_within_probe<'cx, 'tcx>(
206206 }
207207 }
208208 OverlapMode :: Strict => {
209- if strict_disjoint ( selcx, param_env , & impl1_header , impl2_header ) {
209+ if strict_disjoint ( selcx, impl1_def_id , impl2_def_id ) {
210210 return None ;
211211 }
212+
213+ // Equate for error reporting
214+ let _ = selcx
215+ . infcx ( )
216+ . at ( & ObligationCause :: dummy ( ) , param_env)
217+ . eq_impl_headers ( & impl1_header, & impl2_header) ;
212218 }
213219 OverlapMode :: WithNegative => {
214220 if stable_disjoint ( selcx, param_env, & impl1_header, impl2_header)
215- || explicit_disjoint ( selcx, impl1_def_id, impl2_def_id)
216- || explicit_disjoint ( selcx, impl2_def_id, impl1_def_id)
221+ || strict_disjoint ( selcx, impl1_def_id, impl2_def_id)
217222 {
218223 return None ;
219224 }
@@ -255,13 +260,11 @@ fn stable_disjoint<'cx, 'tcx>(
255260
256261fn strict_disjoint < ' cx , ' tcx > (
257262 selcx : & mut SelectionContext < ' cx , ' tcx > ,
258- param_env : ty:: ParamEnv < ' tcx > ,
259- impl1_header : & ty:: ImplHeader < ' tcx > ,
260- impl2_header : ty:: ImplHeader < ' tcx > ,
263+ impl1_def_id : DefId ,
264+ impl2_def_id : DefId ,
261265) -> bool {
262- disjoint_with_filter ( selcx, param_env, impl1_header, impl2_header, |selcx, o| {
263- strict_check ( selcx, o)
264- } )
266+ explicit_disjoint ( selcx, impl1_def_id, impl2_def_id)
267+ || explicit_disjoint ( selcx, impl2_def_id, impl1_def_id)
265268}
266269
267270fn disjoint_with_filter < ' cx , ' tcx > (
0 commit comments