This commit is contained in:
Mikhail Modin 2016-08-05 18:57:37 +03:00
parent 40f3ee2a01
commit 2f5294e1d6
2 changed files with 7 additions and 4 deletions

View File

@ -772,9 +772,10 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
let mut err = struct_span_err!(tcx.sess, impl_item.span, E0201,
"duplicate definitions with name `{}`:",
impl_item.name);
span_note!(&mut err, *entry.get(),
"previous definition of `{}` here",
impl_item.name);
err.span_label(*entry.get(),
&format!("previous definition of `{}` here",
impl_item.name));
err.span_label(impl_item.span, &format!("duplicate definition"));
err.emit();
}
Vacant(entry) => {

View File

@ -12,7 +12,9 @@ struct Foo;
impl Foo {
fn orange(&self) {} //~ NOTE previous definition of `orange` here
fn orange(&self) {} //~ ERROR duplicate definitions with name `orange`
fn orange(&self) {}
//~^ ERROR duplicate definition
//~| NOTE duplicate definition
}
fn main() {}