@@ -313,7 +313,9 @@ fn implicit_negative<'cx, 'tcx>(
313
313
predicate : p,
314
314
} )
315
315
. chain ( obligations)
316
- . find ( |o| loose_check ( selcx, o) || tcx. features ( ) . negative_impls && strict_check ( selcx, o) ) ;
316
+ . find ( |o| {
317
+ loose_check ( selcx, o) || tcx. features ( ) . negative_impls && negative_impl_exists ( selcx, o)
318
+ } ) ;
317
319
// FIXME: the call to `selcx.predicate_may_hold_fatal` above should be ported
318
320
// to the canonical trait query form, `infcx.predicate_may_hold`, once
319
321
// the new system supports intercrate mode (which coherence needs).
@@ -377,8 +379,10 @@ fn negative_impl<'cx, 'tcx>(
377
379
}
378
380
} ;
379
381
380
- let opt_failing_obligation =
381
- obligations. into_iter ( ) . chain ( more_obligations) . find ( |o| strict_check ( selcx, o) ) ;
382
+ let opt_failing_obligation = obligations
383
+ . into_iter ( )
384
+ . chain ( more_obligations)
385
+ . find ( |o| negative_impl_exists ( selcx, o) ) ;
382
386
383
387
if let Some ( failing_obligation) = opt_failing_obligation {
384
388
debug ! ( "overlap: obligation unsatisfiable {:?}" , failing_obligation) ;
@@ -396,7 +400,7 @@ fn loose_check<'cx, 'tcx>(
396
400
!selcx. predicate_may_hold_fatal ( o)
397
401
}
398
402
399
- fn strict_check < ' cx , ' tcx > (
403
+ fn negative_impl_exists < ' cx , ' tcx > (
400
404
selcx : & SelectionContext < ' cx , ' tcx > ,
401
405
o : & PredicateObligation < ' tcx > ,
402
406
) -> bool {
0 commit comments