Skip to content

not a member of trait Foo error label in trait impl of different name for associated types #36428

@nagisa

Description

@nagisa
Member
trait Peach {}

impl Peach for bool { 
    type Banana = ();
}

results in

error[E0437]: type `Banana` is not a member of trait `Peach`
 --> <anon>:5:5
  |
5 |     type Banana = ();
  |     ^^^^^^^^^^^^^^^^^ not a member of trait `Foo`

cc @jonathandturner

Activity

durka

durka commented on Sep 12, 2016

@durka
Contributor

d'oh

ResolutionError::TypeNotMemberOfTrait(type_, trait_) => {
let mut err = struct_span_err!(resolver.session,
span,
E0437,
"type `{}` is not a member of trait `{}`",
type_,
trait_);
err.span_label(span, &format!("not a member of trait `Foo`"));
err
}
ResolutionError::ConstNotMemberOfTrait(const_, trait_) => {
let mut err = struct_span_err!(resolver.session,
span,
E0438,
"const `{}` is not a member of trait `{}`",
const_,
trait_);
err.span_label(span, &format!("not a member of trait `Foo`"));
err
}

added a commit that references this issue on Sep 13, 2016
0a62676
added a commit that references this issue on Sep 15, 2016
23e0c24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @durka@nagisa@apasel422

        Issue actions

          not a member of trait `Foo` error label in trait impl of different name for associated types · Issue #36428 · rust-lang/rust