Rust

E0210 Type Parameter Orphan Rule Fix

E0210 is the covered-parameter half of the orphan rules. The other half - no local type anywhere in the impl - is E0117, and the two are easy to confuse because both fire on impl headers for foreign traits. E0210 is narrower: a local type may even be present in the impl, but one of the impl's type parameters shows up uncovered - as the Self type itself, under a reference, or inside a foreign Self type - before the first local type that could cover it. This guide works the shapes that produce E0210, shows the repairs running, and separates the neighbors that sit in the same header but carry different codes: E0117 when no type in the impl is local at all, and E0207 when the parameter is simply never used.

Written November 30, 2026 · Tested with Rust 1.99.0 · 19 min read

By the end of this guide
  • The rule underneath: covered parameters and the first local type
  • How to read the diagnostic
  • The first failures: the parameter in the Self position
  • What is allowed: the controls

Written November 30, 2026

Tested with Rust 1.99.0

What this guide is

Error E0210 is a violation of the orphan rules that is specifically about type parameters. The error codes index opens: "This error indicates a violation of one of Rust's orphan rules for trait implementations. The rule concerns the use of type parameters in an implementation of a foreign trait (a trait defined in another crate), and states that type parameters must be "covered" by a local type." Its summary of the requirement is that, when implementing a foreign trait, "A type local to your crate must appear before any use of any type parameters."

The practical payoff is the split from the neighboring orphan error. E0117 is the case where nothing in the impl is local - a foreign trait, a foreign Self type, and only foreign trait parameters. E0210 is the case where the impl's own type parameter is the problem: it appears uncovered, most plainly as the Self type itself. The repairs differ accordingly. E0117 asks for a local type somewhere in the impl; E0210 asks for the parameter to be covered - used as an argument to a local type - or for the parameter to stop sitting in the uncovered position. Both repairs, and the local-trait escape that sidesteps the foreign-trait rules entirely, are shown running below.

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: covered parameters and the first local type

The error index states the general rule over an impl written as impl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0: one of the types in the impl must be a local type - that part is the E0117 requirement - and, letting Ti be the first local type among them, "No uncovered type parameters P1..=Pm may appear in T0..Ti (excluding Ti)". A parameter is covered when it appears as an argument to a local type, the way T appears inside MyType<T>; it is uncovered when it stands on its own, as the whole Self type, under a reference, or as a direct argument of a foreign type.

The Rust Reference's orphan rules section states the same test for coherence: "a trait implementation is only allowed if either the trait or at least one of the types in the implementation is defined in the current crate", and its formal version repeats the two conditions - at least one local type, and no uncovered type parameters before the first local type. The Reference adds the fundamental-type note: "for the purposes of coherence, fundamental types are special. The T in Box is not considered covered, and Box is considered local." Wrapping a parameter in a foreign wrapper, even Box, does not cover it; the covering type has to be local (or a fundamental type wrapping a local type).

The index adds one warning that the probes below qualify: "Please note that a type alias is not sufficient." In the probed set, that held for an alias that expands to a foreign type - that shape is E0117, with the neighbors below - while an alias that expands to a local type carried the parameter into the local type and compiled, as control c3 shows. Read the alias by what it expands to, not by the fact that it is an alias.

How to read the diagnostic

Every E0210 failure in the probed set carries the same header: "type parameter T must be used as an argument to some local type (e.g., MyStruct<T>)". The span underlines the parameter in the impl header and labels it "uncovered type parameter" - the underline is the exact occurrence the rule objects to, which is why the same T can be accepted in one position of a header and rejected in another. Two notes follow in every probed E0210 case: "implementing a foreign trait is only possible if at least one of the types for which it is implemented is local" and "only traits defined in the current crate can be implemented for a type parameter". The second note names the blunt repair - define the trait locally - and the first names the covering repair. The neighbors read differently: E0117's header names the foreign Self type ("Vec is not defined in the current crate", "u32 is not defined in the current crate") rather than a parameter, and E0207's header says the parameter "is not constrained", rather than uncovered.

The first failures: the parameter in the Self position

The smallest shape is the Self type as a bare parameter - a blanket impl of a foreign trait for every type at once. With the standard library's Default as the foreign trait:

Rust
impl<T> std::default::Default for T {
    fn default() -> Self {
        panic!()
    }
}
fn main() {}
Output
error[E0210]: type parameter `T` must be used as an argument to some local type (e.g., `MyStruct<T>`)
 --> p1.rs:1:6
  |
1 | impl<T> std::default::Default for T {
  |      ^ uncovered type parameter
  |
  = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
  = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to 1 previous error

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

Nothing in this impl is local: the trait is foreign and the Self type is the parameter itself, and the code the compiler assigns is E0210, not E0117 - in the probed set, a bare parameter in the Self position is read as an uncovered parameter first. The same header with a different foreign trait, Display, produces the identical diagnostic structure:

Rust
impl<T> std::fmt::Display for T {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "x")
    }
}
fn main() {}
Output
error[E0210]: type parameter `T` must be used as an argument to some local type (e.g., `MyStruct<T>`)
 --> p2.rs:1:6
  |
1 | impl<T> std::fmt::Display for T {
  |      ^ uncovered type parameter
  |
  = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
  = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to 1 previous error

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

Putting the parameter under a reference does not cover it. A reference is not a local type, so &T in the Self position is the same uncovered occurrence:

Rust
impl<T> std::default::Default for &T {
    fn default() -> Self {
        panic!()
    }
}
fn main() {}
Output
error[E0210]: type parameter `T` must be used as an argument to some local type (e.g., `MyStruct<T>`)
 --> p3.rs:1:6
  |
1 | impl<T> std::default::Default for &T {
  |      ^ uncovered type parameter
  |
  = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
  = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to 1 previous error

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

The parameter also stays uncovered inside a foreign generic Self type, when no local type appears anywhere in the impl to cover it. Here T sits inside Vec<T> as Self and again as the bare trait argument, and the impl names no local type at all:

Rust
impl<T> std::convert::AsRef<T> for Vec<T> {
    fn as_ref(&self) -> &T {
        panic!()
    }
}
fn main() {}
Output
error[E0210]: type parameter `T` must be used as an argument to some local type (e.g., `MyStruct<T>`)
 --> p4.rs:1:6
  |
1 | impl<T> std::convert::AsRef<T> for Vec<T> {
  |      ^ uncovered type parameter
  |
  = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
  = note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to 1 previous error

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

In all four shapes the fix direction is the one the header states: the parameter must end up as an argument to some local type, or the impl must stop being a foreign-trait impl over an uncovered parameter.

What is allowed: the controls

Three controls in the probed set mark where the rule stops. First, a bare parameter as a trait argument is not, by itself, the violation: when the Self type is a local type, AsRef<T> with T standing alone as the trait argument compiled (with a panic!() body standing in for the conversion, which the orphan check does not inspect):

Rust
struct MyType2;
impl<T> std::convert::AsRef<T> for MyType2 {
    fn as_ref(&self) -> &T {
        panic!()
    }
}
fn main() {
    let _m = MyType2;
}

This program compiles in the probed set. That is the sharpest contrast with p4: the same bare T as a trait argument fails when the Self type is the foreign Vec<T> with no local type anywhere, and passes when the Self type is the local MyType2. The position of the first local type, not the mere presence of a parameter, is what the header is reporting.

Second, a parameter covered by a local type in the trait argument satisfies the rule even when the Self type is foreign. This is the swapped form of p4 - the trait argument is now MyType<T>, the local type carrying the parameter, and the impl compiles:

Rust
struct MyType<T>(T);
impl<T> std::convert::AsRef<MyType<T>> for Vec<T> {
    fn as_ref(&self) -> &MyType<T> {
        panic!()
    }
}
fn main() {
    let _v: Vec<u32> = vec![7];
}

This program compiles in the probed set and runs with no output. Read it together with p4: identical Self type, identical foreign trait, and the only change is that the trait argument wraps T in the local MyType. That one covering occurrence is the difference between E0210 and a working impl.

Third, an alias that expands to a local type behaves as the local type. The error index's own workaround shape - its MyType<T> covering the parameter - reached through an alias name:

Rust
use std::panic::UnwindSafe as ForeignTrait;
struct MyType<T>(T);
type Alias<T> = MyType<T>;
impl<T> ForeignTrait for Alias<T> {}
fn main() {
    let _a: Alias<u32> = MyType(1);
}

This program compiles in the probed set. Compare neighbor n2 below, where the alias expands to Vec<T> instead: the compiler expands the alias before applying the rule, names Vec in the diagnostic, and assigns E0117. The alias itself is neither sufficient nor insufficient - what it expands to decides, in the probed set.

The traps: neighbors that are not E0210

Trap
Three nearby shapes fail differently, or for a different reason.

A foreign trait implemented for a foreign type, with no parameter and no local type anywhere, is E0117 - the other orphan code, covered in full in the E0117 orphan rule guide. Drop for the primitive u32 is the error index's own E0117 example, and in the probed set it carries a second code as well, because Drop additionally may only be implemented for local types:

Rust
impl Drop for u32 {
    fn drop(&mut self) {}
}
fn main() {}
Output
error[E0117]: only traits defined in the current crate can be implemented for primitive types
 --> n1.rs:1:1
  |
1 | impl Drop for u32 {
  | ^^^^^^^^^^^^^^---
  |               |
  |               `u32` is not defined in the current crate
  |
  = note: impl doesn't have any local type before any uncovered type parameters
  = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
  = note: define and implement a trait or new type instead

error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
 --> n1.rs:1:15
  |
1 | impl Drop for u32 {
  |               ^^^ must be a struct, enum, or union in the current crate

error: aborting due to 2 previous errors

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

The split to remember: if the diagnostic names a type ("u32 is not defined in the current crate"), the impl has no local type and the code is E0117; if it names a parameter ("uncovered type parameter"), a parameter sits before the first local type and the code is E0210. The bare-parameter Self of p1 is the boundary case - no local type anywhere, yet E0210, because the Self position itself is the parameter.

An alias expanding to a foreign type lands on the E0117 side of that split. Written through the alias, the impl looks generic over a local-sounding name; expanded, the Self type is Vec<T> and there is no local type in the impl:

Rust
type Alias<T> = Vec<T>;
impl<T> std::panic::UnwindSafe for Alias<T> {}
fn main() {}
Output
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
 --> n2.rs:2:1
  |
2 | impl<T> std::panic::UnwindSafe for Alias<T> {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------
  |                                    |
  |                                    `Vec` is not defined in the current crate
  |
  = note: impl doesn't have any local type before any uncovered type parameters
  = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
  = note: define and implement a trait or new type instead

error: aborting due to 1 previous error

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

Note the note the two orphan codes share in different words: E0117's "impl doesn't have any local type before any uncovered type parameters" is the same first-local-type test E0210 applies - the codes differ in which failure the compiler reports first, the missing local type or the uncovered parameter, and in the probed set a Self type that is itself the parameter reports as E0210 while a Self type that is a foreign type reports as E0117.

Last, a parameter that appears nowhere in the impl is not an orphan problem at all. On a local trait - where no orphan rule applies - an unused impl parameter is E0207, "not constrained":

Rust
trait Local {}
struct MyType;
impl<T> Local for MyType {}
fn main() {}
Output
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
 --> n3.rs:3:6
  |
3 | impl<T> Local for MyType {}
  |     -^-
  |     ||
  |     |unconstrained type parameter
  |     help: remove the unused type parameter `T`

error: aborting due to 1 previous error

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

E0207's repair is the opposite direction from E0210's: remove the parameter, or use it so it constrains the impl. Adding a local type to cover it, the E0210 repair, does nothing for a parameter that is not used at all.

Fixes in reach order

First, cover the parameter with a local type in the Self position - the newtype wrapper. The p1 failure, with the parameter wrapped in the local MyType<T> and Default implemented for the wrapper instead of for the bare parameter, compiles and runs:

Rust
struct MyType<T>(T);
impl<T: Default> std::default::Default for MyType<T> {
    fn default() -> Self {
        MyType(T::default())
    }
}
fn main() {
    let m: MyType<u32> = MyType::default();
    println!("{}", m.0);
}
Output
0

The output is 0, the default u32 carried inside the wrapper. This is the error index's own workaround - its example covers the parameter with a local MyType in exactly this way - and it is the standard shape behind the newtype pattern: the wrapper is local, the parameter appears only as its argument, and the foreign trait is then implemented for a local type. Any bounds the parameter needs move onto the impl, as the T: Default bound does here.

Second, if the parameter is uncovered only because of where it sits, move the covering occurrence earlier - the c2 control is this repair applied to p4: keeping the foreign Vec<T> Self type and changing the trait argument from the bare T to MyType<T> turned the E0210 failure into a compiling impl, because the parameter's first relevant occurrence is then as the argument of a local type. Scope that to the probed pair: it worked for the AsRef shapes probed here, and it does not rescue the bare-parameter Self shapes p1 to p3, where the uncovered occurrence is the Self type itself and only a wrapper (the first fix) or a local trait (the third fix) applies.

Third, define the trait locally. A trait defined in your own crate is not a foreign trait, so the orphan rules do not restrict its impls at all - the compiler's own closing note in every E0210 transcript points here ("only traits defined in the current crate can be implemented for a type parameter"). The blanket impl that p1 and p2 attempted, over a local trait instead, compiles and runs:

Rust
trait LocalName {
    fn name(&self) -> &'static str;
}
impl<T> LocalName for T {
    fn name(&self) -> &'static str {
        "any"
    }
}
fn main() {
    println!("{}", 7u32.name());
    println!("{}", "hi".name());
}
Output
any
any

The output is any twice - once for the integer, once for the string - because the blanket impl genuinely covers every type once the trait is local. The trade is reach: a local trait only helps code that can name your trait, so this repair fits when the consumers are yours, and the wrapper (the first fix) is the repair when the foreign trait itself - Default, Display, a serialization trait - is what downstream code requires.

Last, when the neighboring code is the real one, switch playbooks: E0117 means no type in the impl is local - add a local type in the Self position or as a trait parameter, or define a local trait, as the E0117 guide works through; for Drop specifically, the newtype wrapper is the whole repair, and the p1-style wrapper carrying a Drop impl compiles and runs:

Rust
struct Wrap(u32);
impl Drop for Wrap {
    fn drop(&mut self) {}
}
fn main() {
    let w = Wrap(42);
    println!("{}", w.0);
}
Output
42

The output is 42, the wrapped value read back before the value drops at the end of main. And E0207 means the parameter constrains nothing - remove it or use it; no orphan repair applies.

Decision summary

E0210, "type parameter must be used as an argument to some local type", is the covered-parameter half of the orphan rules in this guide's probed set. It fired for a foreign trait implemented with the Self type as a bare parameter (Default and Display for T), for the parameter under a reference (Default for &T), and for the parameter inside a foreign Self type with no local type anywhere in the impl (AsRef<T> for Vec<T>). It did not fire when the Self type was local and the parameter stood bare as the trait argument (AsRef<T> for a local type), when the parameter was covered by a local type in the trait argument (AsRef<MyType<T>> for Vec<T>), or when an alias expanding to a local type carried the parameter into that local type. The neighbors are distinct in the probed set: a foreign trait for a foreign type with no local type and no parameter in the Self position is E0117 (Drop for u32, additionally carrying E0120; an alias expanding to Vec<T>), and a parameter used nowhere in a local trait's impl is E0207. The repairs act on the parameter's position: wrap it in a local type in the Self position, move a covering occurrence into the trait arguments where the Self position allows it, or define the trait locally and keep the blanket impl.

Checklist

  • Read the diagnostic's noun first: in the probed set, E0210 names a parameter ("uncovered type parameter"), E0117 names a type ("is not defined in the current crate"), and E0207 names a parameter as "not constrained" - three different repairs.
  • Find the underlined occurrence: in the probed set, the span marks the exact uncovered use of the parameter, and the same parameter in a covered position of the same header is accepted.
  • Check what covers the parameter, not just whether a local type exists: in the probed set, Vec<T> and &T in the Self position left the parameter uncovered, while MyType<T> in either the Self position or the trait argument covered it.
  • Expand aliases before judging them: in the probed set, an alias to a local type compiled and an alias to a foreign type was E0117.
  • Do not reach for a foreign wrapper as the cover: per the Reference, the parameter inside a fundamental type such as Box<T> is not considered covered - the covering type must be local.
  • If the trait is yours to define, consider defining it locally first: in the probed set, the blanket impl over a local trait compiled and ran unchanged, because no orphan rule applies to a local trait.

Sources

  • Rust error codes index, E0210 - this error indicates a violation of one of Rust's orphan rules for trait implementations; the rule concerns the use of type parameters in an implementation of a foreign trait (a trait defined in another crate) and states that type parameters must be "covered" by a local type; when implementing a foreign trait for a foreign type, the trait must have one or more type parameters and a type local to your crate must appear before any use of any type parameters; the erroneous example implementing a foreign trait for a bare T; the workaround covering the parameter with a local MyType; the note that a type alias is not sufficient; the two-parameter examples where an uncovered first trait parameter fails and the swapped, covered order is permitted; the general rule that one of the types must be a local type and no uncovered type parameters may appear in the types up to (excluding) the first local type.
  • The Rust Reference, Trait implementation coherence - a trait implementation is considered incoherent if either the orphan rules check fails or there are overlapping implementation instances; the orphan rule states that a trait implementation is only allowed if either the trait or at least one of the types in the implementation is defined in the current crate; the formal rule that at least one of the types must be a local type and no uncovered type parameters may appear before the first such type; the note that only the appearance of uncovered type parameters is restricted, and that for coherence fundamental types are special - the T in Box<T> is not considered covered, and Box<LocalType> is considered local.
  • Rust error codes index, E0117 - the neighboring orphan code: only traits defined in the current crate can be implemented for arbitrary types; the rule prohibits any implementation of a foreign trait where the type implementing the trait is foreign and all of the parameters being passed to the trait (if there are any) are also foreign; the erroneous example impl Drop for u32; the repairs of referencing at least one local type in the impl or defining a trait locally instead.

Keep Exploring