Skip to content

Commit

Permalink
Fix allow_negative_impls logic
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Oct 20, 2021
1 parent 68d444f commit 5a72753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Expand Up @@ -1129,8 +1129,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
candidates.retain(|candidate| {
if let ImplCandidate(def_id) = candidate {
ty::ImplPolarity::Reservation == tcx.impl_polarity(*def_id)
|| !self.allow_negative_impls
&& stack.obligation.polarity() == tcx.impl_polarity(*def_id)
|| stack.obligation.polarity() == tcx.impl_polarity(*def_id)
|| self.allow_negative_impls
} else {
true
}
Expand Down

0 comments on commit 5a72753

Please sign in to comment.