Rust

Fix Rust E0277 "the trait bound ... is not satisfied" — Missing Trait Impl, Missing Ord, the ? Conversion, Sized, and Clone

Some operation stated a requirement — this type must implement that trait — and the type in hand does not. This guide separates the reasons: a trait that was never implemented for the type, a library method whose bound the element type does not meet, a question mark operator asking for a conversion that does not exist, an unsized value passed where a known size is required, and a Clone bound on a type that cannot be cloned — and matches each one to its repair.

Written November 22, 2026 · Tested with Rust 1.99.0 · 20 min read

By the end of this guide
  • The rule underneath: a bound is a requirement checked at the use
  • How to read the diagnostic
  • The first failure: a generic bound the argument type does not meet
  • The second failure: a library method whose bound the element type does not meet

Written November 22, 2026

Tested with Rust 1.99.0

What this guide is

Error E0277 has one sentence at its center, taken from the error codes index: you tried to use a type which does not implement some trait in a place which expected that trait. Every E0277 is a failed requirement with three parts, and the diagnostic names all three: the trait, the type, and the place that imposed the requirement. Fix the right part and the error goes; fix any other part and the error moves or multiplies.

The five places this guide works through are the ones that produce most E0277 reports in ordinary code. A generic function declares a bound — say T: Display — and is called with a struct that never implemented Display. A standard library method declares the bound for you: sorting a slice requires its elements to implement Ord, and a struct with no ordering fails it. The ? operator imposes a bound of its own, a From conversion from the error you have to the error your function returns. A function parameter imposes the quietest bound of all, the implicit Sized bound every type parameter carries, and a slice passed by value fails it. And a generic helper that duplicates its argument requires Clone, which a struct holding a String does not have until it is derived or written.

In each family the failing program is small, the full compiler output is shown, and the fix is the smallest change that satisfies the stated bound — implementing the trait, deriving it, writing the conversion, or borrowing instead of owning. Then the fixes in reach order, the traps, a decision summary, and a checklist.

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: a bound is a requirement checked at the use

A trait defines behavior a type can share, and a trait bound states that a generic type must have that behavior before the generic code may use it — the formulation the Rust Book chapter on traits builds its examples on. The Reference page on trait and lifetime bounds lists where bounds are written, and the place decides when the failure appears:

  • After a generic parameter: fn show<T: Display>(value: T) and fn show<T>(value: T) where T: Display are the same requirement in two spellings. The where clause is the form that stays readable when there are several parameters or several bounds.
  • On a trait declaration, as a supertrait: trait Ord: Eq + PartialOrd means nothing implements Ord without also implementing Eq and PartialOrd. A missing supertrait surfaces as the supertrait's own E0277.
  • On an associated type: trait A { type B: Copy; } requires every implementation's B to be Copy.
  • Inside an impl block header: impl<T: Clone> Wrapper<T> makes the methods in that block available only when the bound holds, so the bound is part of the method's requirements too.
  • Implicitly: every type parameter carries a Sized bound unless it is relaxed with ?Sized. Nothing in the source says T: Sized, and the compiler enforces it anyway — the std documentation for Sized states the rule directly: all type parameters have an implicit bound of Sized, and ?Sized removes it where that is appropriate.

Two checking rules explain where the error is reported. A bound on a generic item must be satisfied when the item is used, so a call with a concrete type that lacks the trait is rejected at the call. And a generic function's body may use only what its bounds declare: the error codes index makes the point with a function that formats its parameter with {:?} while declaring no Debug bound — the function is rejected at its definition even though the only call passes a type that implements Debug, because Rust checks the signature's promises, not the call sites it happens to see. So an E0277 at a definition means a bound is missing from the declaration; an E0277 at a call means the concrete type fails a bound that was declared.

How to read the diagnostic

The first line names the trait and the type: the trait bound Score: Ord is not satisfied, or Point doesn't implement std::fmt::Display. Read it as a sentence — type on the left of the colon, trait on the right — and that sentence is the requirement that failed.

The lines under it locate the requirement. A note saying "required by a bound in show" points at the declaration that imposed the bound, and the compiler shows that declaration with the bound underlined. A line saying "required by a bound introduced by this call" points at the call that supplied the failing type. When the bound comes from the standard library, the note names the library item instead — "required by a bound in slice::<impl [T]>::sort" — which tells you the requirement is not yours to edit: the element type must change, or the call must.

The help lines propose the mechanical repair when one exists: "the trait Ord is not implemented for Score", "consider annotating Score with #[derive(Ord)]", "the trait Sized is not implemented for [T]". A derive suggestion is the compiler telling you the trait is derivable for this type and no implementation exists yet. Where no derive exists — Display is the common case — the help stops at naming the missing implementation, and writing it is the fix.

The first failure: a generic bound the argument type does not meet

A function that prints any value with {} needs that value to implement Display, and it says so in its bound. A local struct does not implement Display by default — the std documentation for Display notes that, unlike Debug, Display is for user-facing output and cannot be derived — so passing the struct fails the bound:

Rust
use std::fmt::Display;

struct Point {
    x: i32,
    y: i32,
}

fn show<T: Display>(value: T) {
    println!("{value}");
}

fn main() {
    show(Point { x: 1, y: 2 });
}
Terminal
$ rustc --edition 2021 fail_display.rs -o fail_display
error[E0277]: `Point` doesn't implement `std::fmt::Display`
  --> fail_display.rs:13:10
   |
13 |     show(Point { x: 1, y: 2 });
   |     ---- ^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |     |
   |     required by a bound introduced by this call
   |
help: the trait `std::fmt::Display` is not implemented for `Point`
  --> fail_display.rs:3:1
   |
 3 | struct Point {
   | ^^^^^^^^^^^^
note: required by a bound in `show`
  --> fail_display.rs:8:12
   |
 8 | fn show<T: Display>(value: T) {
   |            ^^^^^^^ required by this bound in `show`

error: aborting due to 1 previous error

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

The diagnostic gives the whole chain in four parts: the call is underlined as the place where the bound was introduced, the help names the missing implementation, and the note shows the bound in show that required it. Nothing is wrong with the function and nothing is wrong with the call's shape; the type simply lacks the trait. Because Point is a local type, the repair is open: implement the trait for it. The Display page's own example implements it for a point type in exactly this shape:

Rust
use std::fmt::{self, Display};

struct Point {
    x: i32,
    y: i32,
}

impl Display for Point {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "({}, {})", self.x, self.y)
    }
}

fn show<T: Display>(value: T) {
    println!("{value}");
}

fn main() {
    show(Point { x: 1, y: 2 });
}
Terminal
$ rustc --edition 2021 fix_display.rs -o fix_display
$ ./fix_display
(1, 2)

The alternative repairs fit other situations, not this one. If the type were from another crate and the trait from a third, the orphan rule described in the Book's trait chapter would bar the implementation, and the standard moves are a wrapper type of your own that implements the trait, or a call that does not need it — printing with {:?} under a Debug bound, for example, when debug output is what you actually want. And if the value only needs printing inside your own function, dropping the generic entirely and taking the concrete type removes the bound by removing the generality. Keep the generic when other types will genuinely pass through it.

The second failure: a library method whose bound the element type does not meet

sort on a slice requires the element type to implement Ord: the method's own declaration carries the bound, so the failure appears at the call even though your code declares no bound anywhere. The std documentation for Ord defines it as the trait for types that form a total order, with Eq and PartialOrd as supertraits:

Rust
#[derive(Debug)]
struct Score {
    points: u32,
}

fn main() {
    let mut scores = vec![Score { points: 30 }, Score { points: 10 }, Score { points: 20 }];
    scores.sort();
    println!("{scores:?}");
}
Terminal
$ rustc --edition 2021 fail_sort.rs -o fail_sort
error[E0277]: the trait bound `Score: Ord` is not satisfied
 --> fail_sort.rs:8:12
  |
8 |     scores.sort();
  |            ^^^^ the trait `Ord` is not implemented for `Score`
  |
note: required by a bound in `slice::<impl [T]>::sort`
 --> /rustc/b940084d7eb6a299eb4bfeb8e34901bc051e7ac4/library/alloc/src/slice.rs:131:4
help: consider annotating `Score` with `#[derive(Ord)]`
  |
2 + #[derive(Ord)]
3 | struct Score {
  |

error: aborting due to 1 previous error

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

The note is the tell: "required by a bound in slice::<impl [T]>::sort", with a location inside the standard library rather than in your file. The requirement belongs to the method, so the fix must land on the element type or on the choice of method. Ord is derivable, and the compiler's help says so. Deriving it means deriving its supertraits too — the Ord page instructs that if you derive it, you should derive all four traits — and the derived order is lexicographic over the fields in declaration order:

Rust
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
struct Score {
    points: u32,
}

fn main() {
    let mut scores = vec![Score { points: 30 }, Score { points: 10 }, Score { points: 20 }];
    scores.sort();
    println!("{scores:?}");
}
Terminal
$ rustc --edition 2021 fix_sort.rs -o fix_sort
$ ./fix_sort
[Score { points: 10 }, Score { points: 20 }, Score { points: 30 }]

When the type should not have a total order at all — a score with a floating-point field is the standard case, since floating-point values do not form a total order — the fix is the other half: change the call, not the type. sort_by takes a comparison closure and requires no bound on the element type, and sort_by_key sorts by a derived key. Both keep the data unordered as a type while ordering this one list.

The third failure: the ? operator and the missing From

The ? operator does more than return early. On an Err it converts the error value into the enclosing function's error type using the From trait — the conversion is part of the operator's definition, and the std documentation for From is the contract it uses. When no such conversion exists, the failure is E0277 at the ?:

Rust
use std::num::ParseIntError;

enum AppError {
    Empty,
}

fn read_number(text: &str) -> Result<i32, ParseIntError> {
    text.parse()
}

fn parse_number(text: &str) -> Result<i32, AppError> {
    let _ = AppError::Empty;
    let n = read_number(text)?;
    Ok(n)
}

fn main() {
    match parse_number("42") {
        Ok(n) => println!("{n}"),
        Err(_) => println!("parse failed"),
    }
}
Terminal
$ rustc --edition 2021 fail_from.rs -o fail_from
error[E0277]: `?` couldn't convert the error to `AppError`
  --> fail_from.rs:13:30
   |
11 | fn parse_number(text: &str) -> Result<i32, AppError> {
   |                                --------------------- expected `AppError` because of this
12 |     let _ = AppError::Empty;
13 |     let n = read_number(text)?;
   |             -----------------^ the trait `From<ParseIntError>` is not implemented for `AppError`
   |             |
   |             this can't be annotated with `?` because it has type `Result<_, ParseIntError>`
   |
note: `AppError` needs to implement `From<ParseIntError>`
  --> fail_from.rs:3:1
   |
 3 | enum AppError {
   | ^^^^^^^^^^^^^
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait

error: aborting due to 1 previous error

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

Read this one from the note upward: "AppError needs to implement From<ParseIntError>", and the explanation under it states that the question mark operation implicitly performs a conversion on the error value using the From trait. The inner function succeeded or failed on its own terms; the failure is purely at the boundary between the two error types. The fix is to write the conversion the operator asked for — one From implementation, after which every ? over that error type in functions returning AppError works:

Rust
use std::num::ParseIntError;

enum AppError {
    Parse(ParseIntError),
}

impl From<ParseIntError> for AppError {
    fn from(source: ParseIntError) -> Self {
        AppError::Parse(source)
    }
}

fn read_number(text: &str) -> Result<i32, ParseIntError> {
    text.parse()
}

fn parse_number(text: &str) -> Result<i32, AppError> {
    let n = read_number(text)?;
    Ok(n)
}

fn main() {
    match parse_number("42") {
        Ok(n) => println!("{n}"),
        Err(AppError::Parse(e)) => println!("parse error: {e}"),
    }
}
Terminal
$ rustc --edition 2021 fix_from.rs -o fix_from
$ ./fix_from
42

Two details matter here. Implement From, not Into: From implementations provide the corresponding Into automatically, and the operator's bound is stated in terms of From. And the conversion has to be written by the owner of one of the two types — here AppError is local, so the implementation is legal; when both error types are foreign, wrap one of them in a local error enum first, which is the same shape as AppError itself.

The fourth failure: Sized — an unsized value passed by value

A slice type [T] has no size known at compile time: its length is part of the value at run time, not of the type. A function parameter is passed by value, and a by-value parameter must have a statically known size, so a parameter typed [T] fails the implicit Sized bound at the function's own definition — before any call is even possible:

Rust
use std::fmt::Debug;

#[allow(dead_code)]
fn print_items<T: Debug>(items: [T]) {
    println!("{}", items.len());
}

fn main() {}
Terminal
$ rustc --edition 2021 fail_sized.rs -o fail_sized
error[E0277]: the size for values of type `[T]` cannot be known at compilation time
 --> fail_sized.rs:4:33
  |
4 | fn print_items<T: Debug>(items: [T]) {
  |                                 ^^^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[T]`
help: function arguments must have a statically known size, borrowed slices always have a known size
  |
4 | fn print_items<T: Debug>(items: &[T]) {
  |                                 +

error: aborting due to 1 previous error

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

The help line carries the whole doctrine: "the trait Sized is not implemented for [T]", and the suggested rewrite is the fix — "function arguments must have a statically known size, borrowed slices always have a known size". A reference to a slice is a pointer plus a length, both fixed size, so borrowing the slice satisfies the bound without copying anything:

Rust
use std::fmt::Debug;

fn print_items<T: Debug>(items: &[T]) {
    println!("{} items: {items:?}", items.len());
}

fn main() {
    print_items(&[1, 2, 3]);
}
Terminal
$ rustc --edition 2021 fix_sized.rs -o fix_sized
$ ./fix_sized
3 items: [1, 2, 3]

The same shape covers the other unsized types. A str parameter becomes &str. A trait object written bare, as a parameter of type dyn Trait, becomes &dyn Trait or Box<dyn Trait> — a box owns the value through a pointer, so the box itself is sized even though the trait object behind it is not. The general rule: unsized values are always handled through a pointer of some kind — reference, box, or another smart pointer — never held directly by value. Relaxing the bound with ?Sized is the remaining option, and it fits generic parameters that are only ever used behind a reference in the body; it does not make a by-value parameter legal, because the call still has to move a value of unknown size.

The fifth failure: a Clone bound on a type that cannot be cloned

A helper that returns two copies of its argument must clone one of them, and its bound says so. A struct gains Clone only by deriving it or implementing it — there is no automatic cloning for structs, even when every field is cloneable. The std documentation for Clone states the derive condition: the derived implementation clones each field, and it is available when all fields are Clone:

Rust
fn duplicate<T: Clone>(value: T) -> (T, T) {
    (value.clone(), value)
}

struct Token {
    text: String,
}

fn main() {
    let (a, b) = duplicate(Token { text: String::from("hi") });
    println!("{} {}", a.text, b.text);
}
Terminal
$ rustc --edition 2021 fail_clone.rs -o fail_clone
error[E0277]: the trait bound `Token: Clone` is not satisfied
  --> fail_clone.rs:10:28
   |
10 |     let (a, b) = duplicate(Token { text: String::from("hi") });
   |                  --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `Token`
   |                  |
   |                  required by a bound introduced by this call
   |
note: required by a bound in `duplicate`
  --> fail_clone.rs:1:17
   |
 1 | fn duplicate<T: Clone>(value: T) -> (T, T) {
   |                 ^^^^^ required by this bound in `duplicate`
help: consider annotating `Token` with `#[derive(Clone)]`
   |
 5 + #[derive(Clone)]
 6 | struct Token {
   |

error: aborting due to 1 previous error

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

The note points back at the bound in duplicate, and the help proposes the derive by name. Token's only field is a String, which is Clone, so the derive is the whole fix:

Rust
fn duplicate<T: Clone>(value: T) -> (T, T) {
    (value.clone(), value)
}

#[derive(Clone)]
struct Token {
    text: String,
}

fn main() {
    let (a, b) = duplicate(Token { text: String::from("hi") });
    println!("{} {}", a.text, b.text);
}
Terminal
$ rustc --edition 2021 fix_clone.rs -o fix_clone
$ ./fix_clone
hi hi

When a field is not Clone — a file handle wrapper, a type from a crate that withheld the implementation — the derive fails with the same error one level down, naming the field's type. Then the choices are to implement Clone by hand in terms of what can be duplicated, to change the helper so it borrows instead of duplicating, or to pass the value by reference at the call and clone only where a second owner is genuinely needed. What does not work is adding Copy instead: Copy requires Clone as a supertrait, and a type holding a String cannot be Copy at all, because copying it bit for bit would duplicate ownership of the heap allocation.

The fixes in reach order

  • Read the first line as a sentence — this type, this trait — then find the note that says where the bound lives: your function, a library item, an operator, or the implicit Sized bound.
  • If the type is yours and the trait is derivable — Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash — derive it, together with any supertraits the derive requires.
  • If the trait is not derivable, above all Display, write the implementation on your type. One implementation satisfies every call site at once.
  • If the failing bound is the ? operator's, implement From<InnerError> for your error type. Do not restructure the function around one call site.
  • If the failing trait is Sized, stop passing the value by value: take &[T] instead of [T], &str instead of str, &dyn Trait or Box<dyn Trait> instead of a bare trait object.
  • If the type is foreign and the trait is foreign, you cannot write the implementation. Wrap the type in a local struct and implement the trait on the wrapper, or change the call.
  • If the type should not have the trait at all, change the call to one with weaker bounds: sort_by or sort_by_key instead of sort, a &T parameter instead of a T: Clone helper.
  • If the error is at your own generic function's definition, the bound is missing from the declaration, not from the type: add it — T: Debug where the body formats with {:?}, and likewise for every trait the body uses.

Traps

  • Adding the bound to your function does not create the implementation. fn show<T: Display> called with a type lacking Display fails at the call; restating the bound in more places produces more errors, not fewer.
  • Deriving only part of a supertrait chain fails one level up. #[derive(Ord)] alone reports the missing PartialOrd or Eq as its own E0277; derive the whole chain the trait page lists.
  • Display cannot be derived. Code that derives happily for Debug stops at Display; the implementation is a short hand-written fmt method, and confusing the two traits sends the fix in the wrong direction.
  • Implementing Into by hand does not satisfy ?. The operator's bound is on From; implement From and Into follows.
  • ?Sized is not an implementation of Sized. It relaxes a generic parameter so unsized types may be named there; values of that parameter still have to live behind a pointer.
  • Deriving Clone moves the error rather than fixing it when a field is not Clone — the new diagnostic names the field's type, which is the type that now needs the decision.
  • A bound satisfied for the wrong reason still compiles wrong. Deriving Ord orders by fields in declaration order; if the intended order is a different field, the program sorts — into an order you did not mean. Check the output, not just the absence of the error.

Decision summary

  • The note says "required by a bound in" one of your functions, and the type is yours: implement or derive the trait on the type.
  • The note names a standard library item, such as slice::<impl [T]>::sort: the element or key type needs the trait, or the call needs replacing with a weaker-bound variant.
  • The diagnostic says the ? could not convert the error: implement From for your error type from the inner error type.
  • The failing trait is Sized and the type is a slice, a string slice, or a trait object: borrow it or box it; do not pass it by value.
  • The error is reported inside your generic function's definition: a bound the body uses is missing from the signature; add the bound there.
  • Both the type and the trait belong to other crates: wrap the type, or change the call — the direct implementation is not yours to write.

Checklist

  • The first line of the diagnostic read as type : trait, and the failing pair identified.
  • The "required by a bound in" note followed to the declaration that imposed the bound.
  • Derivable trait derived, with its supertraits; non-derivable trait implemented by hand.
  • For ? failures, From implemented on the local error type — not Into, not a call-site workaround.
  • For Sized failures, the parameter changed to a reference or a box, and call sites updated to match.
  • Foreign type plus foreign trait handled with a wrapper, not an illegal implementation.
  • The fixed program run, and its output checked against the intended behavior — field order for derived Ord, format for hand-written Display.

Sources

Keep Exploring