From 74454c4888a0a5a5bca17b5adb1440c6b552608b Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 22 Oct 2021 11:04:30 -0300 Subject: [PATCH] Add comment about the only way to prove NotImplemented here --- .../src/traits/select/candidate_assembly.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 77b1c279efa..d6c681d9f9f 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -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 {