//! constructor provide a method with the same name.
use hir::def_id::DefId;
-use rustc::traits::{self, ProjectionMode};
+use rustc::traits::{self, Reveal};
use rustc::ty::{self, TyCtxt};
use syntax::ast;
use rustc::dep_graph::DepNode;
for (i, &impl1_def_id) in impls.iter().enumerate() {
for &impl2_def_id in &impls[(i+1)..] {
- self.tcx.infer_ctxt(None, None, ProjectionMode::Topmost).enter(|infcx| {
+ self.tcx.infer_ctxt(None, None, Reveal::ExactMatch).enter(|infcx| {
if traits::overlapping_impls(&infcx, impl1_def_id, impl2_def_id).is_some() {
self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id)
}
self.tcx.sess, self.tcx.span_of_impl(impl_def_id).unwrap(), E0119,
"conflicting implementations of trait `{}`{}:",
overlap.trait_desc,
- overlap.self_desc.map_or(String::new(),
- |ty| format!(" for type `{}`", ty)));
+ overlap.self_desc.clone().map_or(String::new(),
+ |ty| format!(" for type `{}`", ty)));
match self.tcx.span_of_impl(overlap.with_impl) {
Ok(span) => {
- err.span_note(span, "conflicting implementation is here:");
+ err.span_label(span,
+ &format!("first implementation here"));
+ err.span_label(self.tcx.span_of_impl(impl_def_id).unwrap(),
+ &format!("conflicting implementation{}",
+ overlap.self_desc
+ .map_or(String::new(),
+ |ty| format!(" for `{}`", ty))));
}
Err(cname) => {
err.note(&format!("conflicting implementation in crate `{}`",