diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 6d845accc64945200f9e356d10180dd67c9e6d6d..0c4071b8b5d9c6d9861e7fb0c3e268d20c465f2b 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -1088,15 +1088,14 @@ fn candidate_from_obligation_no_cache<'o>(&mut self, } match self.is_knowable(stack) { - Some(Conflict::Downstream { used_to_be_broken: true }) if false => { - // ignore this for future-compat. - } None => {} Some(conflict) => { debug!("coherence stage: not knowable"); // Heuristics: show the diagnostics when there are no candidates in crate. let candidate_set = self.assemble_candidates(stack)?; - if !candidate_set.ambiguous && candidate_set.vec.is_empty() { + if !candidate_set.ambiguous && candidate_set.vec.iter().all(|c| { + !self.evaluate_candidate(stack, &c).may_apply() + }) { let trait_ref = stack.obligation.predicate.skip_binder().trait_ref; let self_ty = trait_ref.self_ty(); let trait_desc = trait_ref.to_string();