Use != Positive rather than == Negative
Feels more complete, and for ImplPolarity has the side-effect of making sure we also handle reservation impls correctly
This commit is contained in:
parent
4b87c0b9c9
commit
127e42d33b
6 changed files with 6 additions and 6 deletions
|
@ -710,7 +710,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||
// Don't register additional associated type bounds for negative bounds,
|
||||
// since we should have emitten an error for them earlier, and they will
|
||||
// not be well-formed!
|
||||
if polarity == ty::PredicatePolarity::Negative {
|
||||
if polarity != ty::PredicatePolarity::Positive {
|
||||
assert!(
|
||||
self.tcx().dcx().has_errors().is_some(),
|
||||
"negative trait bounds should not have bindings",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue