Rust

E0404 Expected Trait Found Struct Fix

A bound does not ask for a type. It asks for a trait, a promise about what a type can do. When the name after the colon belongs to a struct, an enum, or any other item that is not a trait, the compiler stops with E0404, expected trait, found struct, and underlines the name with the label not a trait. The name was found. That is what separates this error from a missing name. The repair is a kind repair: make the named item a trait, name a trait that already exists, or keep the struct as a plain type and move the behavior the bound was reaching for into a trait of its own. This guide shows each shape of the mistake and each repair, and separates the two mirror cases that are not E0404 at all: a name that resolves to nothing, and a trait used where a type belongs.

Written November 27, 2026 · Tested with Rust 1.99.1 · 27 min read

By the end of this guide
  • The error: a bound naming a struct
  • The same error names whatever kind it found
  • A type alias in a bound is still not a trait
  • A built-in type in a bound, and the one help block in this family

Written November 27, 2026

Tested with Rust 1.99.1

What this guide is

E0404 is the error for a name that resolves to the wrong kind of item in a place that requires a trait. A trait name shows up in four common places: as a bound on a generic parameter, as in T: NotATrait; as the trait in an implementation, as in impl NotATrait for Widget; as a trait object type, as in &dyn NotATrait; and as a supertrait, as in trait Sub: NotATrait. In all four places the name has to name a trait. If it names a struct, an enum, a union, a type alias, or a built-in type instead, the compiler stops with expected trait, found, and then the kind of item it actually found.

That wording carries the diagnosis. The compiler is not saying the name is missing. A missing name is a different error, E0405, covered at the end of this guide. Here the name was found, looked up, and classified, and the classification is the problem. Every E0404 fix is therefore a kind fix: change what the name refers to so that it refers to a trait, change the line so that it names a trait that already exists, or restructure the code so the bound asks for behavior through a trait while the struct stays a struct. The sections below take the shapes in that order: first the bound naming each kind of wrong item, then the four repairs, then the same error in the impl, dyn, and supertrait positions, and finally the two neighboring errors that are easy to confuse with this one.

The error: a bound naming a struct

This function promises to accept any value, as long as the value's type provides NotATrait. The trouble is that NotATrait is defined in the same file, two lines above the function, and it is defined as a struct:

Rust
struct NotATrait;

fn print_it<T: NotATrait>(x: T) {
    let _ = x;
}

fn main() {
    print_it(1);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found struct `NotATrait`
 --> main.rs:3:16
  |
3 | fn print_it<T: NotATrait>(x: T) {
  |                ^^^^^^^^^ not a trait

error: aborting due to 1 previous error

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

The header names the code, what was expected, and what was found: error[E0404], expected trait, found struct NotATrait. The span underlines the name in the bound and labels it not a trait. There is no help block and no suggestion, because the compiler has done its whole job already: it found the name, and the name is the wrong kind of thing. Nothing about the call in main matters yet. The bound itself is rejected before any argument is checked against it, so changing the argument from 1 to a value of some other type would change nothing.

Read the label closely, because it rules things out. The compiler is not saying that i32 fails to satisfy the bound. It never reaches the question of which types satisfy what. A bound is a contract written in trait names, and a struct name cannot stand in that contract, any more than a struct name can be called like a function. The struct exists to be a type: to hold fields, to be constructed, to be passed around. A trait exists to be a requirement: to name a set of methods and associated items that a type can promise to provide. E0404 is the compiler refusing to let one job be written with the other job's name.

The same error names whatever kind it found

A struct is the most common wrong item, and it is the one in this guide's title, but the header is not fixed text. The compiler names the kind it actually found, and each kind produces its own wording. An enum in bound position:

Rust
enum Shape {
    Round,
    Square,
}

fn print_it<T: Shape>(x: T) {
    let _ = x;
}

fn main() {
    print_it(Shape::Round);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found enum `Shape`
 --> main.rs:6:16
  |
6 | fn print_it<T: Shape>(x: T) {
  |                ^^^^^ not a trait

error: aborting due to 1 previous error

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

The header now reads expected trait, found enum Shape, and the label is still not a trait. An enum is a type, like a struct: it names a set of values a program can hold. It does not name a set of methods a type can promise. Putting an enum in a bound usually means the design wanted a closed set of cases and a generic requirement at the same time, and those two wants have to be separated: the generic parameter can be bounded by a trait, and the enum can be the concrete type passed in, or the enum can implement a trait and the bound can name that trait. What cannot happen is the enum name itself doing the trait's job.

A union in bound position fails the same way, with its own kind word:

Rust
union Number {
    whole: i32,
    fraction: f32,
}

fn print_it<T: Number>(x: T) {
    let _ = x;
}

fn main() {
    print_it(Number { whole: 1 });
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found union `Number`
 --> main.rs:6:16
  |
6 | fn print_it<T: Number>(x: T) {
  |                ^^^^^^ not a trait

error: aborting due to 1 previous error

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

The header reads expected trait, found union Number. The pattern across the struct, enum, and union cases is the whole point: the second half of the header is a report about the item the name resolved to, and it will keep changing as the item changes. When you read an E0404 in your own code, read that second half first. It tells you what the name in your bound actually is, which is often a surprise: a name you remember writing as a trait may have been rewritten as a struct during a refactor, or the bound may be naming the data type from the same design where the trait has a different, similar name.

A type alias in a bound is still not a trait

A type alias feels closer to a trait than a struct does, because an alias can stand for a long type expression and it is tempting to use one as shorthand for a requirement. The compiler treats an alias in trait position as its own case of this error. Here the alias stands for the struct from the first example:

Rust
struct NotATrait;

type AlsoNot = NotATrait;

fn print_it<T: AlsoNot>(x: T) {
    let _ = x;
}

fn main() {
    print_it(NotATrait);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found type alias `AlsoNot`
 --> main.rs:5:16
  |
5 | fn print_it<T: AlsoNot>(x: T) {
  |                ^^^^^^^ type aliases cannot be used as traits

error: aborting due to 1 previous error

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

The header reads expected trait, found type alias AlsoNot, and the label is different from the struct case: type aliases cannot be used as traits. That label is the general rule for aliases in this position, and it holds even when the alias stands for a built-in type rather than a struct:

Rust
type Count = i32;

fn print_it<T: Count>(x: T) {
    let _ = x;
}

fn main() {
    print_it(1);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found type alias `Count`
 --> main.rs:3:16
  |
3 | fn print_it<T: Count>(x: T) {
  |                ^^^^^ type aliases cannot be used as traits

error: aborting due to 1 previous error

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

The header reads expected trait, found type alias Count, with the same label, type aliases cannot be used as traits, even though Count stands for i32. The alias does not become a trait by standing for something else, and it does not become usable as a bound by standing for a trait either. Stable Rust has no trait alias feature: an alias defined with type names a type, full stop, and a bound needs a trait name written directly, or a list of trait names joined in the bound itself. If a bound has grown long enough that an alias seems attractive, the usual repair is a new trait that lists the wanted traits as supertraits, which is the fourth fix below.

A built-in type in a bound, and the one help block in this family

A bound can also name a built-in type directly, with no definition anywhere in the file:

Rust
fn print_it<T: i32>(x: T) {
    let _ = x;
}

fn main() {
    print_it(1);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found builtin type `i32`
 --> main.rs:1:16
  |
1 | fn print_it<T: i32>(x: T) {
  |                ^^^ not a trait
  |
help: you might have meant to write a const parameter here
  |
1 | fn print_it<const T: i32>(x: T) {
  |             +++++

error: aborting due to 1 previous error

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

The header reads expected trait, found builtin type i32, and this is the one case in this family that arrives with a help block: you might have meant to write a const parameter here, with the bound rewritten as const T: i32. That suggestion exists because a generic parameter followed by a colon and a type is a real Rust feature, just not the feature a trait bound uses. A const generic parameter is a value baked into the type, such as an array length, and its declaration names the value's type after the colon. If the code really meant a compile-time number, take the suggestion. If the code meant a requirement on the type T, the help is a sign that the bound was written in the shape of a type annotation, and the repair is one of the trait repairs below.

First fix: make the named item a trait

If the name in the bound was always meant to be a requirement, the definition is the thing that is wrong. Change the item the name refers to from a struct into a trait, give the trait the methods the bound relies on, and implement the trait for the types the function is called with. Here NotATrait keeps its name and its place in the bound, and only its definition changes:

Rust
trait NotATrait {
    fn describe(&self) -> String;
}

impl NotATrait for i32 {
    fn describe(&self) -> String {
        format!("number {}", self)
    }
}

fn print_it<T: NotATrait>(x: T) {
    println!("{}", x.describe());
}

fn main() {
    print_it(42);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
number 42

The program prints number 42 and exits with status 0. The bound T: NotATrait is character-for-character the one that failed before; what changed is that the name now refers to a trait, and i32 has an implementation of it, so the call in main also passes trait checking. Two facts about this repair are worth stating plainly. First, a struct and a trait with the same name cannot coexist in one module, because both live in the type namespace, so this repair replaces the struct rather than adding a namesake beside it. Any code that was constructing the struct as a value has to be redesigned, which is why this is the right fix only when the struct was never really data. Second, defining the trait and implementing it for a concrete type are two steps, and the bound needs both before a call compiles.

Second fix: bound by a trait that already exists

Often the bound reaches for a struct name when the requirement it actually needs is a standard trait, or a trait defined elsewhere in the program. In that case nothing needs to be defined at all: change the name in the bound to the trait that states the requirement. This function needs to print its argument, and the trait that states that requirement is Display from the standard library:

Rust
use std::fmt::Display;

fn print_it<T: Display>(x: T) {
    println!("{}", x);
}

fn main() {
    print_it(42);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
42

The program prints 42 and exits with status 0. The struct name is gone from the bound, because the function never needed that struct. It needed a promise that the argument can be formatted for display, and Display is that promise. This is the most common real-world shape of E0404: the bound names the concrete type the author had in mind while writing the function, instead of the capability the function body actually uses. Read the body, list the operations it performs on the generic value, and let those operations choose the trait. If the body only prints the value, the bound is Display. If it only compares values, the bound is a comparison trait. If it does nothing with the value at all, as several of the failing programs above do with their let _ = x;, the honest bound may be no bound at all, and deleting the bound is a legitimate repair when no operation needs a promise.

Third fix: keep the struct, and give it its behavior through a new trait

The remaining case is the one where the struct is real data and has to stay a struct, but code also wants to require the behavior that data carries. Both wants can be met, by two different names. The struct keeps its name and its fields. A new trait names the behavior. The struct implements the trait. Bounds then name the trait:

Rust
struct NotATrait {
    value: i32,
}

trait Describe {
    fn describe(&self) -> String;
}

impl Describe for NotATrait {
    fn describe(&self) -> String {
        format!("value {}", self.value)
    }
}

fn show<T: Describe>(x: T) {
    println!("{}", x.describe());
}

fn main() {
    show(NotATrait { value: 7 });
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
value 7

The program prints value 7 and exits with status 0. Note what each name is doing now. NotATrait is still constructed as a value in main, with its field set to 7, because it is still a struct. Describe is the name in the bound, because it is a trait. The implementation block is the bridge between them: it states that this struct provides this behavior. This is the standard shape for the whole problem class, and it is the repair to reach for when the first fix is impossible because other code constructs the type, stores it in fields, or matches on it. It is also the repair the official error page points toward when it suggests introducing a new trait with the desired restrictions.

Fourth fix: a new trait as a supertrait bundle

When several bounds travel together, a new trait can also stand in for the whole list. The official error page gives this as its alternative repair: introduce a new trait with the desired restrictions as a supertrait. A trait declared with another trait after its colon requires every implementer to implement that other trait as well, and a bound naming the new trait then carries the requirement with it:

Rust
trait Describe {
    fn describe(&self) -> String;
}

impl Describe for i32 {
    fn describe(&self) -> String {
        format!("number {}", self)
    }
}

trait Loud: Describe {}

impl Loud for i32 {}

fn print_it<T: Loud>(x: T) {
    println!("{}", x.describe());
}

fn main() {
    print_it(42);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
$ ./main.bin
number 42

The program prints number 42 and exits with status 0. The bound names only Loud, and the call still gets to use the describe method, because Loud requires Describe: anywhere a generic value is bounded by a trait, the methods of its supertraits are available on that value. This is the supported answer to the alias temptation from the alias section above. A type alias cannot bundle traits for use in a bound, but a new trait with supertraits can, and the bundle is itself a trait that types implement, which an alias never is.

The same error in impl, dyn, and supertrait positions

The bound is the most common place to meet E0404, but the kind check is the same in the other three positions, and a struct name fails in all of them with the same code. An implementation that names a struct as its trait:

Rust
struct NotATrait;

struct Widget;

impl NotATrait for Widget {}

fn main() {
    let _ = Widget;
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found struct `NotATrait`
 --> main.rs:5:6
  |
5 | impl NotATrait for Widget {}
  |      ^^^^^^^^^ not a trait

error: aborting due to 1 previous error

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

The span sits on the name after impl, the header reads expected trait, found struct NotATrait, and the label is not a trait, exactly as in the bound case. This shape usually comes from the same confusion as the third fix above: the author wants to attach behavior to Widget and reaches for the data type's name. Behavior attaches to a type in two ways, and neither is this one. An inherent implementation, written as impl Widget with no trait named, adds methods that belong to the type itself. A trait implementation, written as impl Describe for Widget, adds the methods of a named trait. The header's first half tells you which of the two the line was trying to be: it expected a trait in that slot, so the repair is to name a trait there, or to drop the name entirely and make the block inherent.

A trait object type naming a struct:

Rust
struct NotATrait;

fn show(x: &dyn NotATrait) {
    let _ = x;
}

fn main() {}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found struct `NotATrait`
 --> main.rs:3:17
  |
3 | fn show(x: &dyn NotATrait) {
  |                 ^^^^^^^^^ not a trait

error: aborting due to 1 previous error

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

The span sits on the name after dyn, and the header and label are again the same. A dyn type is a trait object: it stands for some type, chosen at run time, that implements the named trait. A struct name after dyn is a category error of the same kind, because the struct is already a concrete type and needs no object wrapper. If the value really is that struct, name the struct plainly, without dyn. If the code wants to accept any of several types behind one type, the named item has to be a trait they all implement, which is the third fix again.

And a supertrait list naming a struct:

Rust
struct NotATrait;

trait Sub: NotATrait {}

fn main() {}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0404]: expected trait, found struct `NotATrait`
 --> main.rs:3:12
  |
3 | trait Sub: NotATrait {}
  |            ^^^^^^^^^ not a trait

error: aborting due to 1 previous error

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

The span sits on the name after the colon in the trait declaration, and the error is the same. A supertrait is a requirement placed on implementers, so everything after the colon in a trait declaration is in trait position, and the same four repairs apply there. Position changes nothing in this family. Wherever a trait name is written, the name must refer to a trait, and the header's second half always reports what it refers to instead.

Neighboring errors: the mirror and the missing name

Two nearby mistakes involve the same syntax and carry different codes, because different checks are doing the refusing.

The mirror image of E0404 is a trait used where a type is expected. Here a trait named Pretty is defined correctly, and then used as the type of a function parameter:

Rust
trait Pretty {
    fn pretty(&self) -> String;
}

fn show(x: Pretty) {
    let _ = x.pretty();
}

fn main() {}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0782]: expected a type, found a trait
 --> main.rs:5:12
  |
5 | fn show(x: Pretty) {
  |            ^^^^^^
  |
help: use a new generic type parameter, constrained by `Pretty`
  |
5 - fn show(x: Pretty) {
5 + fn show<T: Pretty>(x: T) {
  |
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
  |
5 | fn show(x: impl Pretty) {
  |            ++++
help: alternatively, use a trait object to accept any type that implements `Pretty`, accessing its methods at runtime using dynamic dispatch
  |
5 | fn show(x: &dyn Pretty) {
  |            ++++

error: aborting due to 1 previous error

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

The code is E0782: expected a type, found a trait. Read the two headers side by side and the symmetry is exact. E0404 says expected trait, found a type-like item. E0782 says expected a type, found a trait. The help blocks in the E0782 output are unusually direct, because the compiler can see the three standard repairs and offers all of them: use a new generic type parameter constrained by the trait, use an opaque impl Trait type, or use a trait object with &dyn. Which one is right depends on how the function is called, but all three start from the same admission: a trait is not a type, so it cannot sit in a type position bare. When a search for one of these codes lands you on a page about the other, this symmetry is why, and the fix direction reverses with the header.

The second neighbor is the missing name. A bound that names a trait that does not exist anywhere fails earlier than E0404, at name resolution:

Rust
fn print_it<T: Missing>(x: T) {
    let _ = x;
}

fn main() {
    print_it(1);
}
Terminal
$ rustc --edition 2021 main.rs -o main.bin
error[E0405]: cannot find trait `Missing` in this scope
 --> main.rs:1:16
  |
1 | fn print_it<T: Missing>(x: T) {
  |                ^^^^^^^ not found in this scope

error: aborting due to 1 previous error

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

The code is E0405: cannot find trait Missing in this scope, and the label is not found in this scope rather than not a trait. For a name that resolves to nothing at all, that label is the whole distinction between the two codes. E0405 means the lookup failed: there is nothing with that name to classify. One edge sits across the line: a name that exists only as a value, a constant or a function, also prints the not found in this scope label, but under E0404, with a note that the name exists in another namespace — the trait lookup still found nothing, and the repair is still to name a real trait. E0404 means the lookup succeeded and the classification failed: there is something with that name, and it is the wrong kind of item. The repairs split along the same line. An E0405 is repaired by making a trait with that name visible, by defining it or importing it. An E0404 is repaired by changing what the visible name refers to, or by naming a different, visible trait. Adding an import to an E0404 changes nothing, because the name was already visible. Defining a trait beside a struct of the same name is impossible, because the name is already taken in the same namespace. Start every diagnosis by reading the label under the span: not found in this scope sends you to definitions and imports, and not a trait sends you to the kind of the item the name already has.

The exact rule: a trait position accepts only a trait

The official page for E0404 opens with the rule in one sentence: a type that is not a trait was used in a trait position, such as a bound or impl. Its erroneous examples cover two of the shapes probed in this guide: an impl naming a struct and a bound naming that same struct, and a bound naming a type alias, where the alias stands for a trait's associated-item form and the page notes that the alias is a type alias. Its advice is to verify that the trait's name was not misspelled and that the right identifier was used. Its corrected example gives the first repair used in this guide: the struct that was named in trait position becomes a trait, the other type implements it, and the same bound then compiles. Its alternative repair is the supertrait bundle: introduce a new trait with the desired restrictions as a supertrait. The page also notes the one exception-shaped case, which is nightly only: a trait alias written with the trait keyword under a feature flag, which is not available to stable programs and is not a repair for code that has to build on the stable compiler.

The Reference's page on traits states where a trait definition lives: the trait declaration defines a trait in the type namespace of the module or block where it is located. That sentence explains why the first fix replaces rather than adds. Structs, enums, unions, type aliases, and traits all place their names in that same type namespace, so one module cannot hold a struct and a trait that share a name, and a name in that namespace refers to exactly one kind of item. The same page notes that generic items may use traits as bounds on their type parameters, which is the bound position: a bound is a use of a name that must resolve, in that namespace, to a trait. It also states the supertrait mechanism behind the fourth fix: supertraits are traits required to be implemented for a type to implement a specific trait, and anywhere a generic value is bounded by a trait, it has access to the associated items of its supertraits. That is the sentence that makes the bundle work: the bound names one trait, and the supertrait's methods come with it.

The fixes, ranked

  • First, check whether the named item was meant to be a requirement at all. If the definition is a leftover struct that nothing constructs as a value, turn the item into a trait, keep the name, and implement the trait for the types the bound is used with. This is the smallest change when the name itself is right and only its kind is wrong.
  • Second, if the function body needs a capability that an existing trait already states, change the bound to name that trait. Read the body and let its operations choose: printing points to Display, formatting for debugging points to the debug formatting trait, comparison points to the comparison traits. Do not define a new trait for a requirement the standard library already names.
  • Third, if the struct is real data that other code constructs and stores, keep it, define a new trait for the behavior, implement that trait for the struct, and change the bound to the trait's name. This is the repair that scales, because more types can implement the same trait later without the bound changing again.
  • Fourth, if the same list of traits appears in bound after bound, define a new trait that carries them as supertraits and bound by the new trait. This replaces the type alias that stable Rust does not allow in trait position.
  • Before choosing any of these, confirm the code really is E0404. A name that resolves to nothing is E0405 and is repaired with a definition or an import. A trait in a type position is E0782 and is repaired in the opposite direction, with a generic parameter, an opaque type, or a trait object.

Which fix for which cause

  • Bound, implementation, trait object, or supertrait names a struct that nothing uses as data: E0404, expected trait, found struct. Turn the item into a trait and implement it for the types involved.
  • Bound names a struct that is real data with fields other code constructs: E0404, found struct. Keep the struct, define a trait for its behavior, implement the trait for the struct, and bound by the trait.
  • Bound names an enum or a union: E0404, found enum or found union. The name is a concrete type, not a requirement. Bound by a trait the type implements, or pass the concrete type without a generic parameter.
  • Bound names a type alias, whatever the alias stands for: E0404, found type alias, with the label that type aliases cannot be used as traits. Write the trait name directly in the bound, or bundle the wanted traits into a new trait with supertraits.
  • Bound names a built-in type such as i32: E0404, found builtin type, with a help block suggesting a const parameter. Take the suggestion if a compile-time value was meant; otherwise replace the name with the trait the body needs.
  • Bound names a trait that exists nowhere in the program: E0405, cannot find trait, with the label not found in this scope. Define the trait or import it; this is a missing name, not a wrong kind.
  • A trait name is used as the type of a parameter, a field, or a variable: E0782, expected a type, found a trait. Use a generic parameter bounded by the trait, an impl Trait parameter, or a dyn trait object.

Checklist

  • Read the second half of the header before anything else. It names the kind of item your name actually refers to, and that report is the diagnosis: struct, enum, union, type alias, and builtin type each point at a different first move.
  • Read the label under the span next. not a trait means the name was found and classified, and the fix is about kind. not found in this scope means no trait with that name is in scope: if no item with that name exists at all, the code is E0405 and the fix is a definition or an import; if the name exists only as a value (a constant or a function), the same label appears under E0404 with a note that the name exists in another namespace, and the fix is still to name a real trait.
  • Decide whether the named item is data or a requirement. If anything in the program constructs it, stores it, or reads its fields, it is data and it stays a struct; the behavior moves into a new trait. If nothing treats it as a value, it can become a trait in place.
  • Let the function body choose the trait when an existing trait will do. List the operations the body performs on the generic value, and name the trait that promises exactly those operations, no more.
  • Do not try to fix an alias by pointing it somewhere else. An alias in trait position fails for every target; write the trait in the bound, or build the supertrait bundle.
  • After the fix, run the program, not just the compiler. The fixed programs in this guide print the value the new trait made usable, and that output line is the proof the bound is not only the right kind but satisfied by the type being passed.

Sources

  • Rust Compiler Error Index, E0404 — for a type that is not a trait being used in a trait position such as a bound or an impl, for verifying that the trait's name was not misspelled and that the right identifier was used, for the corrected example that turns the named struct into a trait, for the alternative repair of introducing a new trait with the desired restrictions as a supertrait, and for the nightly-only trait alias note.
  • The Rust Reference, Traits — for a trait declaration defining a trait in the type namespace of the module or block where it is located, for generic items using traits as bounds on their type parameters, and for supertraits being traits required to be implemented for a type to implement a specific trait, with a bounded value having access to its supertraits' associated items.

Keep Exploring