Skip to content

Commit

Permalink
New output for E0407
Browse files Browse the repository at this point in the history
  • Loading branch information
tvladyslav committed Aug 17, 2016
1 parent 76fa587 commit 2179def
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 @@ -237,12 +237,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 2179def

Please sign in to comment.