Add comment about the only way to prove NotImplemented here

This commit is contained in:
Santiago Pastorino 2021-10-22 11:04:30 -03:00
parent 2e9fb8b68b
commit 74454c4888
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -256,6 +256,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let mut candidates = SelectionCandidateSet { vec: Vec::new(), ambiguous: false };
// 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_from_impls(obligation, &mut candidates);
} else {