Split out ImplPolarity and PredicatePolarity
This commit is contained in:
parent
1447f9d38c
commit
4b87c0b9c9
30 changed files with 169 additions and 95 deletions
|
@ -306,7 +306,7 @@ impl<T> Trait<T> for X {
|
|||
.any(|(pred, _span)| match pred.kind().skip_binder() {
|
||||
ty::ClauseKind::Trait(trait_predicate)
|
||||
if trait_predicate.polarity
|
||||
== ty::ImplPolarity::Positive =>
|
||||
== ty::PredicatePolarity::Positive =>
|
||||
{
|
||||
trait_predicate.def_id() == def_id
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ impl<T> Trait<T> for X {
|
|||
else {
|
||||
continue;
|
||||
};
|
||||
if trait_predicate.polarity != ty::ImplPolarity::Positive {
|
||||
if trait_predicate.polarity != ty::PredicatePolarity::Positive {
|
||||
continue;
|
||||
}
|
||||
let def_id = trait_predicate.def_id();
|
||||
|
|
|
@ -209,7 +209,7 @@ impl<'tcx> FulfillmentError<'tcx> {
|
|||
}
|
||||
|
||||
impl<'tcx> PolyTraitObligation<'tcx> {
|
||||
pub fn polarity(&self) -> ty::ImplPolarity {
|
||||
pub fn polarity(&self) -> ty::PredicatePolarity {
|
||||
self.predicate.skip_binder().polarity
|
||||
}
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
|
|||
match bound_clause.skip_binder() {
|
||||
ty::ClauseKind::Trait(data) => {
|
||||
// Negative trait bounds do not imply any supertrait bounds
|
||||
if data.polarity == ty::ImplPolarity::Negative {
|
||||
if data.polarity == ty::PredicatePolarity::Negative {
|
||||
return;
|
||||
}
|
||||
// Get predicates implied by the trait, or only super predicates if we only care about self predicates.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue