Skip to content

Commit 2693832

Browse files
committed
Rename strict_check to negative_impl_exists
1 parent 7847ca8 commit 2693832

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ fn implicit_negative<'cx, 'tcx>(
313313
predicate: p,
314314
})
315315
.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+
});
317319
// FIXME: the call to `selcx.predicate_may_hold_fatal` above should be ported
318320
// to the canonical trait query form, `infcx.predicate_may_hold`, once
319321
// the new system supports intercrate mode (which coherence needs).
@@ -377,8 +379,10 @@ fn negative_impl<'cx, 'tcx>(
377379
}
378380
};
379381

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));
382386

383387
if let Some(failing_obligation) = opt_failing_obligation {
384388
debug!("overlap: obligation unsatisfiable {:?}", failing_obligation);
@@ -396,7 +400,7 @@ fn loose_check<'cx, 'tcx>(
396400
!selcx.predicate_may_hold_fatal(o)
397401
}
398402

399-
fn strict_check<'cx, 'tcx>(
403+
fn negative_impl_exists<'cx, 'tcx>(
400404
selcx: &SelectionContext<'cx, 'tcx>,
401405
o: &PredicateObligation<'tcx>,
402406
) -> bool {

0 commit comments

Comments
 (0)