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

fix "X is not a member of trait Y" span labels #36429

Merged
merged 1 commit into from
Sep 15, 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
6 changes: 3 additions & 3 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
"method `{}` is not a member of trait `{}`",
method,
trait_);
err.span_label(span, &format!("not a member of `{}`", trait_));
err.span_label(span, &format!("not a member of trait `{}`", trait_));
err
}
ResolutionError::TypeNotMemberOfTrait(type_, trait_) => {
Expand All @@ -257,7 +257,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
"type `{}` is not a member of trait `{}`",
type_,
trait_);
err.span_label(span, &format!("not a member of trait `Foo`"));
err.span_label(span, &format!("not a member of trait `{}`", trait_));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing "trait"? I actually find this better with it.

err
}
ResolutionError::ConstNotMemberOfTrait(const_, trait_) => {
Expand All @@ -267,7 +267,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
"const `{}` is not a member of trait `{}`",
const_,
trait_);
err.span_label(span, &format!("not a member of trait `Foo`"));
err.span_label(span, &format!("not a member of trait `{}`", trait_));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

err
}
ResolutionError::VariableNotBoundInPattern(variable_name, from, to) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/E0407.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Foo for Bar {
fn a() {}
fn b() {}
//~^ ERROR E0407
//~| NOTE not a member of `Foo`
//~| NOTE not a member of trait `Foo`
}

fn main() {
Expand Down
6 changes: 3 additions & 3 deletions src/test/compile-fail/E0438.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

#![feature(associated_consts)]

trait Foo {}
trait Bar {}

impl Foo for i32 {
impl Bar for i32 {
const BAR: bool = true; //~ ERROR E0438
//~| NOTE not a member of trait `Foo`
//~| NOTE not a member of trait `Bar`
}

fn main () {
Expand Down