Skip to content

Commit

Permalink
Rollup merge of rust-lang#35756 - crypto-universe:E0407, r=GuillaumeG…
Browse files Browse the repository at this point in the history
…omez

New output for E0407

Issue rust-lang#35697 as a part of rust-lang#35233.
r? @GuillaumeGomez
  • Loading branch information
eddyb authored Aug 18, 2016
2 parents 64c1aef + 2179def commit c3601d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
err
}
ResolutionError::MethodNotMemberOfTrait(method, trait_) => {
struct_span_err!(resolver.session,
span,
E0407,
"method `{}` is not a member of trait `{}`",
method,
trait_)
let mut err = struct_span_err!(resolver.session,
span,
E0407,
"method `{}` is not a member of trait `{}`",
method,
trait_);
err.span_label(span, &format!("not a member of `{}`", trait_));
err
}
ResolutionError::TypeNotMemberOfTrait(type_, trait_) => {
struct_span_err!(resolver.session,
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0407.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ struct Bar;

impl Foo for Bar {
fn a() {}
fn b() {} //~ ERROR E0407
fn b() {}
//~^ ERROR E0407
//~| NOTE not a member of `Foo`
}

fn main() {
Expand Down

0 comments on commit c3601d4

Please sign in to comment.