Skip to content

Commit

Permalink
Add comment about the only way to prove NotImplemented here
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Oct 22, 2021
1 parent 2e9fb8b commit 74454c4
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -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 {
Expand Down

0 comments on commit 74454c4

Please sign in to comment.