1
Fork 0

Rollup merge of #110671 - compiler-errors:polarity, r=lcnr

Consider polarity in new solver

It's kinda ugly to have a polarity check in all of the builtin impls -- I guess I could consider the polarity at the top of assemble-builtin but that would require adding a polarity fn to `GoalKind`...

🤷 putting this up just so i dont forget, since it's needed to bootstrap core during coherence (this alone does not allow core to bootstrap though, additional work is needed!)

r? ``@lcnr``
This commit is contained in:
Matthias Krüger 2023-04-25 21:06:34 +02:00 committed by GitHub
commit 95e9f68eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 126 additions and 3 deletions

View file

@ -861,6 +861,11 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
pub fn is_const_if_const(self) -> bool {
self.skip_binder().is_const_if_const()
}
#[inline]
pub fn polarity(self) -> ImplPolarity {
self.skip_binder().polarity
}
}
/// `A: B`