@@ -206,14 +206,19 @@ fn overlap_within_probe<'cx, 'tcx>(
206
206
}
207
207
}
208
208
OverlapMode :: Strict => {
209
- if strict_disjoint ( selcx, param_env , & impl1_header , impl2_header ) {
209
+ if strict_disjoint ( selcx, impl1_def_id , impl2_def_id ) {
210
210
return None ;
211
211
}
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) ;
212
218
}
213
219
OverlapMode :: WithNegative => {
214
220
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)
217
222
{
218
223
return None ;
219
224
}
@@ -255,13 +260,11 @@ fn stable_disjoint<'cx, 'tcx>(
255
260
256
261
fn strict_disjoint < ' cx , ' tcx > (
257
262
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 ,
261
265
) -> 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)
265
268
}
266
269
267
270
fn disjoint_with_filter < ' cx , ' tcx > (
0 commit comments