Skip to content

Commit 5a72753

Browse files
committed
Fix allow_negative_impls logic
1 parent 68d444f commit 5a72753

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+2
-2
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/select/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1129,8 +1129,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11291129
candidates.retain(|candidate| {
11301130
if let ImplCandidate(def_id) = candidate {
11311131
ty::ImplPolarity::Reservation == tcx.impl_polarity(*def_id)
1132-
|| !self.allow_negative_impls
1133-
&& stack.obligation.polarity() == tcx.impl_polarity(*def_id)
1132+
|| stack.obligation.polarity() == tcx.impl_polarity(*def_id)
1133+
|| self.allow_negative_impls
11341134
} else {
11351135
true
11361136
}

0 commit comments

Comments
 (0)