Skip to content

Commit

Permalink
Rollup merge of rust-lang#36136 - athulappadan:E0034, r=jonathandturner
Browse files Browse the repository at this point in the history
Update compiler error 0034 to use new format.

Part of rust-lang#35233
Addresses rust-lang#35205

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 30, 2016
2 parents fb574b2 + fb65fe9 commit a1a3474
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/librustc_typeck/check/method/suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
MethodError::Ambiguity(sources) => {
let mut err = struct_span_err!(self.sess(), span, E0034,
"multiple applicable items in scope");
err.span_label(span, &format!("multiple `{}` found", item_name));

report_candidates(&mut err, sources);
err.emit();
Expand Down
14 changes: 11 additions & 3 deletions src/test/compile-fail/E0034.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ trait Trait2 {
fn foo();
}

impl Trait1 for Test { fn foo() {} }
impl Trait2 for Test { fn foo() {} }
impl Trait1 for Test {
fn foo() {}
//~^ NOTE candidate #1 is defined in an impl of the trait `Trait1` for the type `Test`
}

impl Trait2 for Test {
fn foo() {}
//~^ NOTE candidate #2 is defined in an impl of the trait `Trait2` for the type `Test`
}

fn main() {
Test::foo() //~ ERROR E0034
Test::foo() //~ ERROR multiple applicable items in scope
//~| NOTE multiple `foo` found
}

0 comments on commit a1a3474

Please sign in to comment.