diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-11-29 20:47:34 +0200 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-12-05 15:42:34 +0200 |
| commit | 9d38541d3fbc21dfed58877b9181b40169c149a2 (patch) | |
| tree | 9071b7323e5c238ce0454cc84a294d5c95834e51 | |
| parent | 2614cc51dde5e57983dd9809372845073ac30aac (diff) | |
improve error reporting
| -rw-r--r-- | src/librustc/traits/select.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 6d845accc64..0c4071b8b5d 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -1088,15 +1088,14 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { } 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(); |
