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

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 {