Don't treat negative trait predicates as always knowable

This commit is contained in:
Michael Goulet 2023-07-26 01:35:51 +00:00
parent 864bdf7843
commit 808e174dfc

View File

@ -1487,7 +1487,7 @@ fn filter_reservation_impls(
fn is_knowable<'o>(&mut self, stack: &TraitObligationStack<'o, 'tcx>) -> Result<(), Conflict> { fn is_knowable<'o>(&mut self, stack: &TraitObligationStack<'o, 'tcx>) -> Result<(), Conflict> {
debug!("is_knowable(intercrate={:?})", self.is_intercrate()); debug!("is_knowable(intercrate={:?})", self.is_intercrate());
if !self.is_intercrate() || stack.obligation.polarity() == ty::ImplPolarity::Negative { if !self.is_intercrate() {
return Ok(()); return Ok(());
} }