Rust

E0437 Type Not a Member of Trait Fix

E0437 is a name mismatch inside one impl block: the implementation offers an associated type the trait never declared. The trait is the contract, so in every shape in this guide the fix is on the impl side - remove the type, rename it to the declared name, or move it to the trait it belongs to. This guide works the shapes that produce E0437, shows which of them also raise E0046 for the still-missing declared type, and separates the neighboring codes for a wrong-named constant, an extra method, and a mismatched generic associated type.

Written November 30, 2026 · Tested with Rust 1.99.1 · 16 min read

By the end of this guide
  • The rule underneath: an impl may only define what the trait declares
  • How to read the diagnostic
  • The first failure: a type in an impl of an empty trait
  • The rename case: a misspelled name raises E0437 and E0046 together

Written November 30, 2026

Tested with Rust 1.99.1

What this guide is

Error E0437 is an associated type in an impl that the trait does not declare. The error codes index opens with the cause - "An associated type whose name does not match any of the associated types in the trait was used when implementing the trait" - and its erroneous example is the first failure in this guide: an impl of an empty trait that nevertheless defines type Bar = bool;. Its stated solution is the move half of this guide is built around: "remove the extraneous associated type".

The other half is the rename case, and it comes with a companion error. When the impl's type is a misspelling of a name the trait does declare, the compiler reports E0437 for the wrong name and E0046 for the declared name that is still missing - two errors, one typo. Reading the pair correctly is the practical payoff of this guide: in the shapes in this guide, E0437 alone means no type the trait declares is missing and the line is simply extra, while E0437 together with E0046 means a declared type is still missing - and when the wrong name is close to the missing one, as the "similar name" help shows, the repair is a rename, not a deletion.

Build every program in this guide with rustc --edition 2021. In the compiler transcripts below, the file names are the bare names shown on the command line.

The rule underneath: an impl may only define what the trait declares

The Rust Reference's implementations section states the contract this error enforces: "A trait implementation must define all non-default associated items declared by the implemented trait, may redefine default associated items defined by the implemented trait, and cannot define any other items." The same reference's traits section describes where the declared names come from: a trait's interface "consists of associated items, which come in three varieties" - functions, types, and constants - and "Associated types must never define the type, the type may only be specified in an implementation." So an associated type's name is fixed by the trait declaration, and the impl's only job is to supply the type for that name. A name the trait never declared has nothing to supply a type for, and the impl is rejected.

That one rule produces both error pairings in this guide. Defining a name outside the contract is E0437. Failing to define a name inside it is E0046 - covered by the neighboring guide on E0046, and appearing here only as the companion error the rename and wrong-trait shapes raise alongside E0437.

How to read the diagnostic

The header names both parties: "type Bar is not a member of trait Foo" - the type as written in the impl, and the trait being implemented. The span covers the whole type Name = ...; line in the impl, and the label under it repeats the verdict: "not a member of trait Foo". There is no help block in the simplest shapes in this guide's probed set; the diagnostic states the mismatch and stops.

Two variations matter. When the written name is close to a declared name, the span splits and a help label appears under the differing part: "there is an associated type with a similar name: Output". That label is the compiler identifying the rename case for you. And when the declared type is still missing after the wrong-named line, a second error follows - E0046, "not all trait items implemented, missing: Output", spanned on the impl header rather than on a line inside it. In this guide's probed set, E0437 with that E0046 companion means a declared type is still missing - a rename when the "similar name" help points at the missing name, or supplying that name (or moving the line to its own trait) in the wrong-trait case; E0437 alone means no declared type is missing, so the line is extra even when a similar declared name exists and is already implemented.

The first failure: a type in an impl of an empty trait

This is the error index's own example, as a complete program - a trait with no associated items at all, and an impl that defines one anyway:

Rust
trait Foo {}
impl Foo for i32 {
    type Bar = bool;
}
fn main() {}
Output
error[E0437]: type `Bar` is not a member of trait `Foo`
 --> q1.rs:3:5
  |
3 |     type Bar = bool;
  |     ^^^^^^^^^^^^^^^^ not a member of trait `Foo`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0437`.

There is exactly one error and no companion: Foo declares no associated type that Bar could be a misspelling of, so there is nothing missing either. The line is purely extraneous, and the index's solution - remove it - is the whole repair, run in the fixes section.

The rename case: a misspelled name raises E0437 and E0046 together

Here the trait declares Output and the impl writes Outpt. The impl has the right idea and the wrong name, and the compiler says both halves of that:

Rust
trait Source {
    type Output;
}
struct Thing;
impl Source for Thing {
    type Outpt = u32;
}
fn main() {}
Output
error[E0437]: type `Outpt` is not a member of trait `Source`
 --> q2.rs:6:5
  |
6 |     type Outpt = u32;
  |     ^^^^^-----^^^^^^^
  |     |    |
  |     |    help: there is an associated type with a similar name: `Output`
  |     not a member of trait `Source`

error[E0046]: not all trait items implemented, missing: `Output`
 --> q2.rs:5:1
  |
2 |     type Output;
  |     ----------- `Output` from trait
...
5 | impl Source for Thing {
  | ^^^^^^^^^^^^^^^^^^^^^ missing `Output` in implementation

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0046, E0437.
For more information about an error, try `rustc --explain E0046`.

Read the pair as one defect, not two. The split span and the "similar name" help identify Output as the intended name; the E0046 below it confirms that the declared type is otherwise unimplemented - there is no second, correctly named line elsewhere in the impl. Deleting the Outpt line, the repair that works for the first failure, would leave the E0046 standing. The repair here is to rename the line to the declared name, run in the fixes section.

The wrong-trait case: the type belongs to another trait

A name can be spelled exactly right and still not be a member of the trait being implemented, because it is a member of a different trait. Here Other is declared by trait B, but the impl under repair implements trait A:

Rust
trait A {
    type Item;
}
trait B {
    type Other;
}
struct S;
impl A for S {
    type Other = u32;
}
fn main() {}
Output
error[E0437]: type `Other` is not a member of trait `A`
 --> q3.rs:9:5
  |
9 |     type Other = u32;
  |     ^^^^^^^^^^^^^^^^^ not a member of trait `A`

error[E0046]: not all trait items implemented, missing: `Item`
 --> q3.rs:8:1
  |
2 |     type Item;
  |     --------- `Item` from trait
...
8 | impl A for S {
  | ^^^^^^^^^^^^ missing `Item` in implementation

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0046, E0437.
For more information about an error, try `rustc --explain E0046`.

The pairing matches the rename case - E0437 plus E0046 - but there is no "similar name" help, because Other is not similar to Item; it is simply in the wrong impl. Two repairs are possible, and which one is correct depends on intent: if S was meant to implement A, the line must become type Item = ...;; if the type assignment was the point, the impl header is what is wrong, and the line belongs in an impl B for S. The fixes section runs the second repair. Either way, no edit to the trait declarations is involved - in every program in this guide, the traits state the contract correctly and the impl is the side that moves.

The extra case: a correct impl plus one type too many

The declared type can be present, correctly named, and correctly assigned, and E0437 still fires - for the additional line next to it:

Rust
trait Source {
    type Output;
}
struct Thing;
impl Source for Thing {
    type Output = u32;
    type Extra = bool;
}
fn main() {}
Output
error[E0437]: type `Extra` is not a member of trait `Source`
 --> q4.rs:7:5
  |
7 |     type Extra = bool;
  |     ^^^^^^^^^^^^^^^^^^ not a member of trait `Source`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0437`.

This is the first failure's shape inside a non-empty trait: E0437 alone, no E0046, because Output is implemented and nothing is missing. The span tells you which line to remove - it covers Extra, not the impl as a whole - and the correct Output line above it is untouched by the repair.

In this guide's probed set, those four shapes are the E0437 family: a type with no counterpart in an empty trait, a misspelling of a declared name, a name belonging to a different trait, and an extra type alongside the correct one. The first and last raise E0437 alone; the middle two raise it together with E0046 for the declared type left unimplemented.

The traps: neighbors that are not E0437

Trap
Four nearby shapes fail under a different code.

A generic associated type written without its lifetime parameters is not E0437 in the probed set. The name Item is a member of the trait below - what is wrong is that the trait declares it as Item<'a> and the impl writes it with no lifetime parameter, and that mismatch is E0195:

Rust
trait Source {
    type Item<'a> where Self: 'a;
}
struct Thing;
impl Source for Thing {
    type Item = u32;
}
fn main() {}
Output
error[E0195]: lifetime parameters or bounds on associated type `Item` do not match the trait declaration
 --> q5.rs:6:14
  |
2 |     type Item<'a> where Self: 'a;
  |              ----             -- this bound might be missing in the impl
  |              |
  |              lifetimes in impl do not match this associated type in trait
...
6 |     type Item = u32;
  |              ^ lifetimes do not match associated type in trait

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0195`.

The distinction is membership versus signature: in the probed set, a name the trait does not declare at all is E0437, while a declared name whose generic parameters do not match the declaration is E0195. If your span points into the middle of the type line, at the position where parameters would go, rather than underlining the whole line, you are in the second case.

Omitting the declared type entirely is E0046 alone, with no E0437 anywhere - the neighboring guide's subject, shown here only to complete the pairing picture:

Rust
trait Source {
    type Output;
}
struct Thing;
impl Source for Thing {}
fn main() {}
Output
error[E0046]: not all trait items implemented, missing: `Output`
 --> n1.rs:5:1
  |
2 |     type Output;
  |     ----------- `Output` from trait
...
5 | impl Source for Thing {}
  | ^^^^^^^^^^^^^^^^^^^^^ missing `Output` in implementation

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0046`.

See the neighboring guide for E0046 in full. The contrast to hold onto is directional: an impl that defines too little is E0046; an impl that defines a name outside the trait is E0437; an impl that does both at once - the rename and wrong-trait shapes above - reports both.

The same "not a member" sentence for an associated constant carries a different code, E0438. Here the impl defines LIMIT, which Limits does not declare, alongside the declared MAX:

Rust
trait Limits {
    const MAX: u32;
}
struct Thing;
impl Limits for Thing {
    const LIMIT: u32 = 3;
    const MAX: u32 = 3;
}
fn main() {}
Output
error[E0438]: const `LIMIT` is not a member of trait `Limits`
 --> n2.rs:6:5
  |
6 |     const LIMIT: u32 = 3;
  |     ^^^^^^^^^^^^^^^^^^^^^ not a member of trait `Limits`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0438`.

And for a method, the same sentence is E0407. This impl implements the declared greet and adds an extra method the trait does not declare:

Rust
trait Greeter {
    fn greet(&self) -> u32;
}
struct Thing;
impl Greeter for Thing {
    fn greet(&self) -> u32 { 1 }
    fn extra(&self) -> u32 { 2 }
}
fn main() {}
Output
error[E0407]: method `extra` is not a member of trait `Greeter`
 --> n3.rs:7:5
  |
7 |     fn extra(&self) -> u32 { 2 }
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `Greeter`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0407`.

In the probed set the three item kinds split by code: an undeclared associated type is E0437, an undeclared associated constant is E0438, and an undeclared method is E0407. The header's first word - type, const, or method - tells you which kind you wrote, and the repair logic is the same for all three: the name must match a declaration in the trait, be removed, or move to an impl of the trait that declares it. An extra method, unlike an extra type or constant, has one more home available: it can move to an inherent impl Thing block, where no trait contract applies.

Fixes in reach order

First, when the type has no counterpart in the trait, remove it - the error index's own solution. The first failure, with the extraneous line deleted and the impl left empty, compiles and runs:

Rust
trait Foo {}
impl Foo for i32 {}
fn main() { println!("{}", 42); }
Output
42

The output is 42. Nothing else in the program changed, because nothing else was wrong: the trait declared no associated types, and the repaired impl defines none.

Second, when E0437 arrives with the E0046 companion and a "similar name" help, rename the line to the declared name instead of deleting it. The rename case, repaired by writing Output for Outpt, compiles and runs, and the assigned type is usable through the trait:

Rust
trait Source {
    type Output;
}
struct Thing;
impl Source for Thing {
    type Output = u32;
}
fn main() { let v: <Thing as Source>::Output = 7; println!("{}", v); }
Output
7

The output is 7, read back through the <Thing as Source>::Output projection - the declared name the misspelling was standing in for. One edit clears both errors, because both errors were the one typo.

Third, when the impl already contains the declared type and E0437 fires alone on an additional line, remove only that line. The extra case, with Extra deleted and Output kept, compiles and runs:

Rust
trait Source {
    type Output;
}
struct Thing;
impl Source for Thing {
    type Output = u32;
}
fn main() { let v: <Thing as Source>::Output = 9; println!("{}", v); }
Output
9

The output is 9. The source text of this repair happens to match the rename repair above apart from the value printed - which is the point: both end at an impl defining exactly the names the trait declares, no more and no fewer.

Last, when the type belongs to a different trait, move the impl to that trait rather than renaming the type. The wrong-trait case, repaired by implementing B - the trait that actually declares Other - compiles and runs:

Rust
trait A {
    type Item;
}
trait B {
    type Other;
}
struct S;
impl B for S {
    type Other = u32;
}
fn main() { let v: <S as B>::Other = 5; println!("{}", v); }
Output
5

The output is 5, read through the <S as B>::Other projection. The type Other = u32; line is byte-for-byte the line that failed before; only the impl header changed, from A to B. If the implementing type also needs trait A, that is a separate, additional impl supplying Item - the two contracts are satisfied by two impl blocks, never by mixing one trait's items into the other's impl.

Decision summary

E0437, "type is not a member of trait", is one shape in this guide's probed set: a trait impl defines an associated type whose name matches no associated type declared in that trait - a stray type in an impl of a trait declaring none, an extra type alongside the correctly implemented one, a misspelling of a declared name, or a name declared by a different trait. The first two raise E0437 alone; the last two also raise E0046, because the declared type is left unimplemented, and the misspelling additionally draws a "similar name" help pointing at the declared name. The repairs all act on the impl: remove the extraneous type, rename it to the declared name, or implement the trait the name belongs to. The neighbors are distinct in the probed set: a missing declared type alone is E0046, a declared generic associated type written without its lifetime parameters is E0195, an undeclared associated constant is E0438, and an undeclared method is E0407.

Checklist

  • Read the header's two names: the type as written, and the trait being implemented - the mismatch is between exactly those two.
  • Check for a companion E0046: present, the declared type is still missing and the line was probably meant to be it; absent, the line is purely extra.
  • Check for a "similar name" help together with the companion check above: help plus a missing declared type identifies the rename case - rename the line, do not delete it; help with the declared type already implemented means the line is an extra near-copy - delete it.
  • Remove a purely extra type line; keep every line whose name the trait declares.
  • If the name is declared by a different trait, move the impl to that trait (or write that trait's declared name in this impl) - do not add the name to this trait just to silence the error, unless changing the trait is the design change you actually intend.
  • Match the code to the item kind in the probed set: type is E0437, const is E0438, method is E0407 - and a declared name with mismatched generic parameters is E0195, not a membership error.

Sources

  • Rust error codes index, E0437 - an associated type whose name does not match any of the associated types in the trait was used when implementing the trait; the erroneous example of type Bar = bool; in an impl of an empty trait; trait implementations can only implement associated types that are members of the trait in question; the solution of removing the extraneous associated type.
  • The Rust Reference, Implementations - a trait implementation must define all non-default associated items declared by the implemented trait, may redefine default associated items, and cannot define any other items.
  • The Rust Reference, Traits - a trait's interface consists of associated items in three varieties, functions, types, and constants; associated types must never define the type in the trait, the type may only be specified in an implementation.

Keep Exploring