about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits/auto_trait.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-03-21 15:46:40 -0400
committerMichael Goulet <michael@errs.io>2024-03-22 11:16:57 -0400
commit127e42d33b21f05a7d1f2b1925fa28cf37e496c5 (patch)
treed177f9fbfa2bd537b77f7dabe894e158f712e791 /compiler/rustc_trait_selection/src/traits/auto_trait.rs
parent4b87c0b9c98e6399d62550e3293dfe625841731f (diff)
downloadrust-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_trait_selection/src/traits/auto_trait.rs')
-rw-r--r--compiler/rustc_trait_selection/src/traits/auto_trait.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
index 5a12e24a165..c909a0b49e2 100644
--- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs
+++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
@@ -295,7 +295,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
                     }) = impl_source
                     {
                         // Blame 'tidy' for the weird bracket placement.
-                        if infcx.tcx.impl_polarity(*impl_def_id) == ty::ImplPolarity::Negative {
+                        if infcx.tcx.impl_polarity(*impl_def_id) != ty::ImplPolarity::Positive {
                             debug!(
                                 "evaluate_nested_obligations: found explicit negative impl\
                                         {:?}, bailing out",