1
Fork 0

Add comments on Polarity

This commit is contained in:
Santiago Pastorino 2022-03-17 11:10:19 -03:00
parent c3797dcce6
commit 78346489c6
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -748,6 +748,13 @@ pub struct TraitPredicate<'tcx> {
pub constness: BoundConstness,
/// If polarity is Positive: we are proving that the trait is implemented.
///
/// If polarity is Negative: we are proving that a negative impl of this trait
/// exists. (Note that coherence also checks whether negative impls of supertraits
/// exist via a series of predicates.)
///
/// If polarity is Reserved: that's a bug.
pub polarity: ImplPolarity,
}