Rust
E0046 Missing Trait Items Fix
The trait declares an item with no default and the impl leaves it out - a method in one form, a type in another, a constant in a third, two items together in a fourth. This guide separates five shapes that produce E0046 and matches each one to the same repair in five positions: add the item the diagnostic names to the impl block, in the form the trait declares it.
Written November 24, 2026 · Tested with Rust 1.99.1 · 21 min read
- The rule underneath: an impl must supply every required item
- How to read the diagnostic
- The first failure: a missing required method
- The second failure: a missing associated type
Written November 24, 2026
Tested with Rust 1.99.1
What this guide is
Error E0046 is a trait implementation that leaves out a required item. The error codes index states it in one line: items are missing in a trait implementation. Its example defines a trait with one method, implements the trait with an empty block, and draws this error; its fix is to provide the method inside the impl.
The five forms in this guide each reproduce E0046 with a small, complete program, and the kind of item missing is different in each one. A required method with no default. An associated type, which a trait can only name and never assign. An associated constant declared without a value. Two items at once - an associated type and a method - where the diagnostic lists both in a single error. And a method missing from a subtrait, where the supertrait is already implemented and only the subtrait's own item is named. In each family the failing program is small, the full compiler output is shown, and the fix adds only the named item to the impl block.
Four neighboring shapes are not E0046 and are not in the families. Adding a method the trait does not declare is E0407. Giving a trait method the wrong parameter type is E0053. Giving a trait method the wrong number of type parameters is E0049. And implementing a subtrait without implementing its supertrait at all is E0277. The traps section shows each one with its real code. One further program in the traps leaves a trait item out of the impl and compiles, because that item carries a default in the trait - it is the boundary of this error, because only required items can be missing.
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 must supply every required item
A trait, in the words of The Rust Book's trait chapter, defines the functionality a particular type has and can share with other types, and a type's behavior consists of the methods that can be called on it. Inside the trait, each method signature ends in a semicolon instead of a body when the implementor must supply the behavior: the compiler enforces that any type with the trait has that method defined with the signature exactly as declared.
The Rust Reference puts the same rule across all three kinds of associated item. A trait's interface consists of associated functions, associated types, and associated constants. A trait function that omits its body must be defined by the implementation, while a function that defines a body gives a default any implementation may keep. An associated constant may omit its value to indicate that implementations must define it. An associated type never defines the type in the trait at all - the type may only be specified in an implementation. So a required item is any item the trait declares without supplying: a method with no body, a constant with no value, and every associated type.
That is why an empty impl block is sometimes complete and sometimes E0046, and the trait decides which. If every item in the trait carries a default, the empty block supplies nothing and still satisfies the trait - the boundary program in the traps is exactly that shape. If even one item is required, the empty block is missing that item, and so is a block that supplies the other items carefully and leaves this one out. The error is not about how much of the trait an impl provides; it is about whether every required item is present.
Defaults are also the deliberate way to shrink what implementors owe. The Book's trait chapter shows a trait where one method is required and a second method has a default implementation that calls the first: an implementor defines only the required method and receives the defaulted one from the trait. Moving a body, a value, or a sensible fallback into the trait changes the contract for every implementor at once, which is a design decision - the fix for a single E0046, by contrast, is local: add the named item to the one impl the diagnostic points at.
How to read the diagnostic
The header names the missing items directly: "not all trait items implemented, missing: greet". When two items are missing, both names appear in that same header, in trait declaration order, and there is still one error for the whole impl - the fourth family shows missing:Id,label`` in a single E0046. Read the header as the complete shopping list for the impl: every name in it needs an entry, and no name outside it does.
The spans then show the two sides of the omission. One marker underlines the item's declaration inside the trait and is labeled with the item's name "from trait". Another marker underlines the whole impl line and is labeled "missing ... in implementation". The ... between them is the compiler eliding the rest of the file, not a gap in the program. In the subtrait family the line numbers are wider apart - the trait declarations and the two impl blocks take more room - but the layout is identical: declaration above, impl below, the missing name stated at both ends.
There is no help block in any of the five families here, and no suggestion to copy. That absence is itself the reading: the compiler cannot write the method body, choose the associated type, or pick the constant's value for you, because those choices are the implementor's. The diagnostic's job ends at naming what is owed and where it was declared. What the item should contain - what greet returns, what Output is, what MAX equals - comes from the trait's contract and the type's purpose, not from the error.
The first failure: a missing required method
The trait declares greet with a signature and a semicolon, and no body. The impl block is empty, so there is no greet anywhere for Cat:
trait Greeter {
fn greet(&self) -> String;
}
struct Cat;
impl Greeter for Cat {}
fn main() {
let c = Cat;
println!("{}", c.greet());
}
$ rustc --edition 2021 fail_method.rs -o fail_method
error[E0046]: not all trait items implemented, missing: `greet`
--> fail_method.rs:7:1
|
2 | fn greet(&self) -> String;
| -------------------------- `greet` from trait
...
7 | impl Greeter for Cat {}
| ^^^^^^^^^^^^^^^^^^^^ missing `greet` in implementation
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0046`.
The fix adds the method inside the impl, with the signature exactly as the trait declares it - same name, same &self receiver, same String return - and a body that supplies the behavior for this type:
trait Greeter {
fn greet(&self) -> String;
}
struct Cat;
impl Greeter for Cat {
fn greet(&self) -> String {
String::from("meow")
}
}
fn main() {
let c = Cat;
println!("{}", c.greet());
}
$ rustc --edition 2021 fix_method.rs -o fix_method
$ ./fix_method
meow
The output is meow. This is the shape in the error codes index: its example trait has one method, its impl is empty, and its stated fix is to provide the method. Most E0046s in ordinary code are this family at a larger scale - a trait that gained a new required method, or an impl written against a shorter version of the trait - and the repair never changes shape: find the named method in the trait, add it to the impl.
The second failure: a missing associated type
An associated type is named in the trait and assigned only in an impl. This trait declares Output and nothing else, and the impl assigns nothing:
trait Source {
type Output;
}
struct Numbers;
impl Source for Numbers {}
fn main() {
let x: <Numbers as Source>::Output = 42;
println!("{}", x);
}
$ rustc --edition 2021 fail_type.rs -o fail_type
error[E0046]: not all trait items implemented, missing: `Output`
--> fail_type.rs:7:1
|
2 | type Output;
| ----------- `Output` from trait
...
7 | impl Source for Numbers {}
| ^^^^^^^^^^^^^^^^^^^^^^^ missing `Output` in implementation
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0046`.
Note that main already uses the type - it declares a value of <Numbers as Source>::Output - and the compiler still reports only the missing item. The use cannot be satisfied until the impl says what Output is, and the missing assignment is the whole error. The fix assigns it inside the impl, with an equals sign rather than a body:
trait Source {
type Output;
}
struct Numbers;
impl Source for Numbers {
type Output = i32;
}
fn main() {
let x: <Numbers as Source>::Output = 42;
println!("{}", x);
}
$ rustc --edition 2021 fix_type.rs -o fix_type
$ ./fix_type
42
The output is 42, the value declared at that associated type. An associated type is the one item kind that can never be given a default by writing a body in the trait: per the Rust Reference, the type may only be specified in an implementation. When a trait needs implementors to choose a type - an output, an identifier, an error - this is the mechanism, and every impl owes exactly one assignment per associated type it declares.
The third failure: a missing associated constant
A constant declared with a type and a semicolon, and no value, is required in the same way a bodiless method is. This impl provides no value for MAX:
trait Limits {
const MAX: u32;
}
struct Counter;
impl Limits for Counter {}
fn main() {
println!("{}", <Counter as Limits>::MAX);
}
$ rustc --edition 2021 fail_const.rs -o fail_const
error[E0046]: not all trait items implemented, missing: `MAX`
--> fail_const.rs:7:1
|
2 | const MAX: u32;
| -------------- `MAX` from trait
...
7 | impl Limits for Counter {}
| ^^^^^^^^^^^^^^^^^^^^^^^ missing `MAX` in implementation
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0046`.
The span labels follow the same pattern as the method family: MAX from trait at the declaration, missing MAX in implementation at the impl line. The fix supplies the value inside the impl, repeating the declared type:
trait Limits {
const MAX: u32;
}
struct Counter;
impl Limits for Counter {
const MAX: u32 = 100;
}
fn main() {
println!("{}", <Counter as Limits>::MAX);
}
$ rustc --edition 2021 fix_const.rs -o fix_const
$ ./fix_const
100
The output is 100, the value the impl assigns, read back through <Counter as Limits>::MAX - the fully qualified form main uses to name both the type and the trait; the shorter Counter::MAX reaches the same constant while the trait is in scope. A constant differs from the method in one respect worth keeping in mind: its value is fixed at compile time and shared by every value of the type, so choosing it is choosing a property of the type itself - a limit, a capacity, a size - not of any one instance.
The fourth failure: two items missing at once
This trait declares an associated type and a method, and the empty impl omits both. The compiler reports them together:
trait Profile {
type Id;
fn label(&self) -> String;
}
struct User;
impl Profile for User {}
fn main() {
let u = User;
let id: <User as Profile>::Id = 7;
println!("{} {}", u.label(), id);
}
$ rustc --edition 2021 fail_two.rs -o fail_two
error[E0046]: not all trait items implemented, missing: `Id`, `label`
--> fail_two.rs:8:1
|
2 | type Id;
| ------- `Id` from trait
3 | fn label(&self) -> String;
| -------------------------- `label` from trait
...
8 | impl Profile for User {}
| ^^^^^^^^^^^^^^^^^^^^^ missing `Id`, `label` in implementation
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0046`.
One error, two names. The header lists Id and label in declaration order, the trait side shows a span for each declaration, and the impl side repeats both names. There is no second error waiting behind the first: fixing only one of the two and rebuilding produces the same E0046 naming the item that remains, so the header should be read whole before any edit is made. The fix adds both items - the type assignment and the method - in one pass:
trait Profile {
type Id;
fn label(&self) -> String;
}
struct User;
impl Profile for User {
type Id = u32;
fn label(&self) -> String {
String::from("user")
}
}
fn main() {
let u = User;
let id: <User as Profile>::Id = 7;
println!("{} {}", u.label(), id);
}
$ rustc --edition 2021 fix_two.rs -o fix_two
$ ./fix_two
user 7
The output is user 7: the label the method returns, and the identifier value declared at the Id type the impl chose. When a trait grows - a new associated type added beside the existing methods, say - every existing impl that already provides the older items draws this error naming only the new item. A header naming two items, as here, means the impl in front of you is missing both of them, whatever the reason. The repair is still per impl: each implementing type makes its own choice for the new item.
The fifth failure: a missing item in a subtrait
Pet is a subtrait of Animal: per the Rust Reference, supertraits are traits that are required to be implemented for a type to implement a specific trait. Dog implements Animal in full, and its Pet impl is empty:
trait Animal {
fn name(&self) -> String;
}
trait Pet: Animal {
fn play(&self) -> String;
}
struct Dog;
impl Animal for Dog {
fn name(&self) -> String {
String::from("rex")
}
}
impl Pet for Dog {}
fn main() {
let d = Dog;
println!("{} {}", d.name(), d.play());
}
$ rustc --edition 2021 fail_super.rs -o fail_super
error[E0046]: not all trait items implemented, missing: `play`
--> fail_super.rs:17:1
|
6 | fn play(&self) -> String;
| ------------------------- `play` from trait
...
17 | impl Pet for Dog {}
| ^^^^^^^^^^^^^^^^ missing `play` in implementation
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0046`.
The diagnostic names only play, the subtrait's own item. The supertrait is not mentioned, because Animal is already implemented - implementing the subtrait does not re-owe the supertrait's items inside the subtrait's block; each trait's items are supplied in that trait's own impl. The fix adds play to the Pet impl and touches nothing else:
trait Animal {
fn name(&self) -> String;
}
trait Pet: Animal {
fn play(&self) -> String;
}
struct Dog;
impl Animal for Dog {
fn name(&self) -> String {
String::from("rex")
}
}
impl Pet for Dog {
fn play(&self) -> String {
String::from("fetch")
}
}
fn main() {
let d = Dog;
println!("{} {}", d.name(), d.play());
}
$ rustc --edition 2021 fix_super.rs -o fix_super
$ ./fix_super
rex fetch
The output is rex fetch: the name from the supertrait's impl, which was never in question, and the play string from the item just added. A generic trait impl draws the same error in the same form - an impl Converter<i32> that omits its method names that method in one E0046 - because the rule does not change when the trait takes a type parameter: the items of the trait, for the parameter choice in the impl header, are what is owed. What is not this error is leaving the supertrait unimplemented altogether; that shape is in the traps, with a different code.
The fixes in reach order
- One named method missing: add it inside the impl with the trait's exact signature, and a body for this type.
- One named associated type missing: add
type Name = ...;inside the impl, choosing the concrete type this implementor works with. - One named associated constant missing: add
const NAME: Type = value;inside the impl, repeating the declared type. - Several names in one header: add every named item before rebuilding - if any are left out, the error returns naming all of the ones that remain, together in one header.
- The missing item belongs to a subtrait: add it in the subtrait's impl block, not in the supertrait's, and leave a complete supertrait impl alone.
- The impl contains an item the trait does not name, or an item with a mismatched signature: the problem is a surplus or a mismatch, not an omission - see the traps.
Traps
- Adding a method the trait does not declare is E0407, not E0046. This impl supplies
greetcorrectly and then addspurr, which is not a member of the trait. The error codes index gives the cause: a definition of a method not in the implemented trait was given in a trait implementation, and it advises checking for a misspelled name or the wrong trait:
trait Greeter {
fn greet(&self) -> String;
}
struct Cat;
impl Greeter for Cat {
fn greet(&self) -> String {
String::from("meow")
}
fn purr(&self) -> String {
String::from("purr")
}
}
fn main() {
let c = Cat;
println!("{}", c.greet());
}
$ rustc --edition 2021 probe_extra.rs -o probe_extra
error[E0407]: method `purr` is not a member of trait `Greeter`
--> probe_extra.rs:12:5
|
12 | / fn purr(&self) -> String {
13 | | String::from("purr")
14 | | }
| |_____^ not a member of trait `Greeter`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0407`.
impl Cat block, where a type's own extra methods belong.
- Giving a trait method the wrong parameter type is E0053. The method is present, with the right name, but its signature does not match the declaration. The error codes index gives the rule: the parameters of any trait method must match between a trait implementation and the trait definition:trait Speaker {
fn speak(x: u16);
}
struct Bot;
impl Speaker for Bot {
fn speak(_x: i16) {}
}
fn main() {
println!("bot");
}
$ rustc --edition 2021 probe_sig.rs -o probe_sig
error[E0053]: method `speak` has an incompatible type for trait
--> probe_sig.rs:8:18
|
8 | fn speak(_x: i16) {}
| ^^^ expected `u16`, found `i16`
|
note: type in trait
--> probe_sig.rs:2:17
|
2 | fn speak(x: u16);
| ^^^
= note: expected signature `fn(u16)`
found signature `fn(i16)`
help: change the parameter type to match the trait
|
8 - fn speak(_x: i16) {}
8 + fn speak(_x: u16) {}
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0053`.
Read the code to tell an omission from a mismatch: E0046 underlines the whole impl line because the item is not there; E0053 underlines the differing parameter itself and shows both signatures in its notes, with a help that rewrites the parameter type. Change the impl's signature to the trait's - the trait is the contract, and the callers are compiled against it.
- Giving a trait method the wrong number of type parameters is E0049. This trait method is generic, declared with a type parameter T, and the impl writes the method with none. The error codes index gives the cause: an attempted implementation of a trait method has the wrong number of type or const parameters, and its fix is to give the impl's method the same type parameters as the declaration:
trait Maker {
fn make<T: Default>(value: T) -> Self;
}
struct Widget;
impl Maker for Widget {
fn make(_value: bool) -> Self {
Widget
}
}
fn main() {
println!("widget");
}
$ rustc --edition 2021 probe_params.rs -o probe_params
error[E0049]: associated function `make` has 0 type parameters but its trait declaration has 1 type parameter
--> probe_params.rs:8:12
|
2 | fn make<T: Default>(value: T) -> Self;
| - expected 1 type parameter
...
8 | fn make(_value: bool) -> Self {
| ^ found 0 type parameters
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0049`.
The diagnostic counts parameters on both sides - 0 in the impl, 1 in the trait declaration - rather than naming a missing item. Note the neighboring count error this is not: a method present with too few ordinary parameters, rather than too few type parameters, draws a different code again, so read which kind of parameter the header is counting before editing.
- Implementing a subtrait without implementing its supertrait is E0277, not E0046. This program gives Dog a complete Pet impl, play included, and no Animal impl at all:
trait Animal {
fn name(&self) -> String;
}
trait Pet: Animal {
fn play(&self) -> String;
}
struct Dog;
impl Pet for Dog {
fn play(&self) -> String {
String::from("fetch")
}
}
fn main() {
println!("dog");
}
$ rustc --edition 2021 probe_no_super.rs -o probe_no_super
error[E0277]: the trait bound `Dog: Animal` is not satisfied
--> probe_no_super.rs:11:14
|
11 | impl Pet for Dog {
| ^^^ unsatisfied trait bound
|
help: the trait `Animal` is not implemented for `Dog`
--> probe_no_super.rs:9:1
|
9 | struct Dog;
| ^^^^^^^^^^
help: this trait has no implementations, consider adding one
--> probe_no_super.rs:1:1
|
1 | trait Animal {
| ^^^^^^^^^^^^
note: required by a bound in `Pet`
--> probe_no_super.rs:5:12
|
5 | trait Pet: Animal {
| ^^^^^^ required by this bound in `Pet`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
The header is a trait bound complaint - Dog: Animal is not satisfied - and the note points back at the bound in Pet. Compare the fifth family: there Animal was implemented and only play was missing, which is E0046. Here nothing is missing inside an impl; an entire impl is absent, and the repair is to write it, after which any items still owed inside the new blocks are reported as E0046 in their turn.
- An impl that omits a trait item with a default compiles. This trait gives greet a body, and the empty impl keeps that default:
trait Greeter {
fn greet(&self) -> String {
String::from("hello")
}
}
struct Cat;
impl Greeter for Cat {}
fn main() {
let c = Cat;
println!("{}", c.greet());
}
$ rustc --edition 2021 boundary_default.rs -o boundary_default
$ ./boundary_default
hello
The output is hello, the default's return value. This is the boundary of E0046: the same empty impl block that fails in the first family passes here, and the only difference is in the trait - a semicolon where this trait has a body. The Book's trait chapter makes the same point with its default-implementation example, where an empty impl block is enough because the trait supplies the behavior. When you want implementors to owe nothing for an item, the default is how the trait says so.
Checklist
- The header read for every name after "missing:": each named item gets an entry in the impl, and nothing unnamed is added there.
- A missing method: added with the trait's exact signature - name, receiver, parameters, and return type all matching the declaration.
- A missing associated type: assigned with
type Name = ...;inside the impl, never in the trait. - A missing associated constant: assigned with its declared type and a value, inside the impl.
- Several names in one header: all of them added in one pass, rather than fixing one and rebuilding to meet the next.
- The missing item in a subtrait's impl: added to that subtrait's block, with the supertrait's complete impl left untouched.
- An extra method, a mismatched signature, a wrong type-parameter count, or a wholly absent supertrait impl: E0407, E0053, E0049, or E0277 - a surplus, a mismatch, or an absent impl is fixed differently from an omission.
- The fixed program run, and its output checked against what the failing program was trying to compute.
Related guides on this site
- Fix Rust E0277 "the trait bound ... is not satisfied" — Missing Trait Impl, Missing Ord, the ? Conversion, Sized, and Clone
- E0185 Method Has Self but Trait Does Not Fix
- E0186 Method Lacks Self but Trait Has It Fix
- E0120 Drop on Trait Object or Reference Fix
Sources
- Rust, Error codes index: E0046 - items are missing in a trait implementation; when making a type implement a trait, you must at minimum provide implementations for all of its required methods, meaning the methods that do not have default implementations, as well as any required trait items like associated types or constants.
- The Rust Book, Traits: Defining Shared Behavior - a trait defines the functionality a particular type has and can share with other types; each type implementing a trait must provide its own behavior for a method declared with a signature and a semicolon, the compiler enforces that the method is defined with that signature exactly, and a trait may instead give a method a default implementation that an impl may keep or override, including a default that calls a required method in the same trait.
- Rust Reference, Traits - a trait's interface consists of associated functions, types, and constants; a trait function that omits its body must be defined by the implementation, a function with a body acts as a default, an associated constant may omit its value to indicate implementations must define it, an associated type may only be specified in an implementation, and supertraits are traits required to be implemented for a type to implement a specific trait.
- Rust, Error codes index: E0407 - a definition of a method not in the implemented trait was given in a trait implementation; verify the method name was not misspelled and the correct trait was used.
- Rust, Error codes index: E0053 - the parameters of any trait method must match between a trait implementation and the trait definition.
- Rust, Error codes index: E0049 - an attempted implementation of a trait method has the wrong number of type or const parameters; for example a trait method declared with a type parameter whose implementation omits it, fixed by giving both the same type parameters.
Keep Exploring
The full Rust hub \u2014 ownership, structs and enums, async, and measured comparisons.
Every guide on the site in one list, grouped by topic.
Every browser-only checker and verifier on the site.
The C++, Python, Sysadmin, Rust, Go, and TypeScript hubs.