Assemple trait alias candidates for negative polarity

This doesn't work properly yet, we would probably need to implement an
`assembly_neg_candidates` and consider things like `T: !AB` as `T: !A`
|| `T: !B`
This commit is contained in:
Santiago Pastorino 2021-10-22 15:44:47 -03:00
parent da79fa964c
commit 132409f0c6
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -259,6 +259,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// The only way to prove a NotImplemented(T: Foo) predicate is via a negative impl.
// There are no compiler built-in rules for this.
if obligation.polarity() == ty::ImplPolarity::Negative {
self.assemble_candidates_for_trait_alias(obligation, &mut candidates);
self.assemble_candidates_from_impls(obligation, &mut candidates);
} else {
self.assemble_candidates_for_trait_alias(obligation, &mut candidates);