mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Update compiler error 0034 to use new format.
This commit is contained in:
parent
addb753762
commit
fb65fe95eb
@ -242,6 +242,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||||||
MethodError::Ambiguity(sources) => {
|
MethodError::Ambiguity(sources) => {
|
||||||
let mut err = struct_span_err!(self.sess(), span, E0034,
|
let mut err = struct_span_err!(self.sess(), span, E0034,
|
||||||
"multiple applicable items in scope");
|
"multiple applicable items in scope");
|
||||||
|
err.span_label(span, &format!("multiple `{}` found", item_name));
|
||||||
|
|
||||||
report_candidates(&mut err, sources);
|
report_candidates(&mut err, sources);
|
||||||
err.emit();
|
err.emit();
|
||||||
|
@ -18,9 +18,17 @@ trait Trait2 {
|
|||||||
fn foo();
|
fn foo();
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Trait1 for Test { fn foo() {} }
|
impl Trait1 for Test {
|
||||||
impl Trait2 for Test { fn foo() {} }
|
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() {
|
fn main() {
|
||||||
Test::foo() //~ ERROR E0034
|
Test::foo() //~ ERROR multiple applicable items in scope
|
||||||
|
//~| NOTE multiple `foo` found
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user