diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-21 15:46:40 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-22 11:16:57 -0400 |
| commit | 127e42d33b21f05a7d1f2b1925fa28cf37e496c5 (patch) | |
| tree | d177f9fbfa2bd537b77f7dabe894e158f712e791 /compiler/rustc_infer/src/traits/util.rs | |
| parent | 4b87c0b9c98e6399d62550e3293dfe625841731f (diff) | |
| download | rust-127e42d33b21f05a7d1f2b1925fa28cf37e496c5.tar.gz rust-127e42d33b21f05a7d1f2b1925fa28cf37e496c5.zip | |
Use != Positive rather than == Negative
Feels more complete, and for ImplPolarity has the side-effect of making sure we also handle reservation impls correctly
Diffstat (limited to 'compiler/rustc_infer/src/traits/util.rs')
| -rw-r--r-- | compiler/rustc_infer/src/traits/util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_infer/src/traits/util.rs b/compiler/rustc_infer/src/traits/util.rs index 0876a54f16d..6d43011d33c 100644 --- a/compiler/rustc_infer/src/traits/util.rs +++ b/compiler/rustc_infer/src/traits/util.rs @@ -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::PredicatePolarity::Negative { + if data.polarity != ty::PredicatePolarity::Positive { return; } // Get predicates implied by the trait, or only super predicates if we only care about self predicates. |
