Rename strict_check to negative_impl_exists
This commit is contained in:
parent
7847ca8c61
commit
269383226f
1 changed files with 8 additions and 4 deletions
|
@ -313,7 +313,9 @@ fn implicit_negative<'cx, 'tcx>(
|
||||||
predicate: p,
|
predicate: p,
|
||||||
})
|
})
|
||||||
.chain(obligations)
|
.chain(obligations)
|
||||||
.find(|o| loose_check(selcx, o) || tcx.features().negative_impls && strict_check(selcx, o));
|
.find(|o| {
|
||||||
|
loose_check(selcx, o) || tcx.features().negative_impls && negative_impl_exists(selcx, o)
|
||||||
|
});
|
||||||
// FIXME: the call to `selcx.predicate_may_hold_fatal` above should be ported
|
// FIXME: the call to `selcx.predicate_may_hold_fatal` above should be ported
|
||||||
// to the canonical trait query form, `infcx.predicate_may_hold`, once
|
// to the canonical trait query form, `infcx.predicate_may_hold`, once
|
||||||
// the new system supports intercrate mode (which coherence needs).
|
// the new system supports intercrate mode (which coherence needs).
|
||||||
|
@ -377,8 +379,10 @@ fn negative_impl<'cx, 'tcx>(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let opt_failing_obligation =
|
let opt_failing_obligation = obligations
|
||||||
obligations.into_iter().chain(more_obligations).find(|o| strict_check(selcx, o));
|
.into_iter()
|
||||||
|
.chain(more_obligations)
|
||||||
|
.find(|o| negative_impl_exists(selcx, o));
|
||||||
|
|
||||||
if let Some(failing_obligation) = opt_failing_obligation {
|
if let Some(failing_obligation) = opt_failing_obligation {
|
||||||
debug!("overlap: obligation unsatisfiable {:?}", failing_obligation);
|
debug!("overlap: obligation unsatisfiable {:?}", failing_obligation);
|
||||||
|
@ -396,7 +400,7 @@ fn loose_check<'cx, 'tcx>(
|
||||||
!selcx.predicate_may_hold_fatal(o)
|
!selcx.predicate_may_hold_fatal(o)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn strict_check<'cx, 'tcx>(
|
fn negative_impl_exists<'cx, 'tcx>(
|
||||||
selcx: &SelectionContext<'cx, 'tcx>,
|
selcx: &SelectionContext<'cx, 'tcx>,
|
||||||
o: &PredicateObligation<'tcx>,
|
o: &PredicateObligation<'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
|
Loading…
Add table
Reference in a new issue