Skip to content

Don't print the same impl twice on ext. overlap #29404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/librustc_typeck/coherence/overlap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,18 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {
"conflicting implementations for trait `{}`",
self.tcx.item_path_str(trait_def_id));

self.report_overlap_note(impl1, impl2);
self.report_overlap_note(impl2);
}

fn report_overlap_note(&self, impl1: DefId, impl2: DefId) {
fn report_overlap_note(&self, impl2: DefId) {

if impl2.is_local() {
span_note!(self.tcx.sess, self.span_of_impl(impl2),
"note conflicting implementation here");
} else {
let crate_store = &self.tcx.sess.cstore;
let cdata = crate_store.get_crate_data(impl2.krate);
span_note!(self.tcx.sess, self.span_of_impl(impl1),
"conflicting implementation in crate `{}`",
cdata.name);
self.tcx.sess.note(&format!("conflicting implementation in crate `{}`", cdata.name));
}
}

Expand Down