Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New output for E0407 #35756

Merged
merged 1 commit into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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