diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-03-17 11:10:19 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-03-17 11:10:19 -0300 |
| commit | 78346489c66779d024c60af2d2f0f5d9d455f688 (patch) | |
| tree | a0fc5b00a15fe345b0c67d3396a8ef5ea36733d5 | |
| parent | c3797dcce68a0b8b51028f2b9c797d300bac94c1 (diff) | |
| download | rust-78346489c66779d024c60af2d2f0f5d9d455f688.tar.gz rust-78346489c66779d024c60af2d2f0f5d9d455f688.zip | |
Add comments on Polarity
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index e7cef9e198b..83ab761aa55 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -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, } |
