Skip to content

Commit 6c094b9

Browse files
Don't print the same impl twice on ext. overlap
1 parent eab5ad5 commit 6c094b9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc_typeck/coherence/overlap.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,18 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {
147147
"conflicting implementations for trait `{}`",
148148
self.tcx.item_path_str(trait_def_id));
149149

150-
self.report_overlap_note(impl1, impl2);
150+
self.report_overlap_note(impl2);
151151
}
152152

153-
fn report_overlap_note(&self, impl1: DefId, impl2: DefId) {
153+
fn report_overlap_note(&self, impl2: DefId) {
154154

155155
if impl2.is_local() {
156156
span_note!(self.tcx.sess, self.span_of_impl(impl2),
157157
"note conflicting implementation here");
158158
} else {
159159
let crate_store = &self.tcx.sess.cstore;
160160
let cdata = crate_store.get_crate_data(impl2.krate);
161-
span_note!(self.tcx.sess, self.span_of_impl(impl1),
162-
"conflicting implementation in crate `{}`",
163-
cdata.name);
161+
self.tcx.sess.note(&format!("conflicting implementation in crate `{}`", cdata.name));
164162
}
165163
}
166164

0 commit comments

Comments
 (0)