E0109 Generic Argument on Non-Generic Type Fix

Written December 3, 2026 · Tested with Rust 1.99.1 · 20 min read

By the end of this guide
  • The rule underneath: a type must declare a parameter before it can take an argument
  • How to read the diagnostic
  • The first failure: the index example
  • The same error in other places

Written December 3, 2026

Tested with Rust 1.99.1

What this guide is

Error E0109 means a generic argument was given to a type that does not take one - a type argument, a lifetime argument, or a const argument supplied in angle brackets to a type that has no parameters for it to fill. The error codes index puts it plainly: you tried to provide a generic argument to a type which doesn't need it, and its advice is to check that you used the correct argument and that the definition is correct.

In the shapes probed in this guide, E0109 fires on its own for the index example, for each half of that example on its own, for a type argument on a second builtin type, for a const argument on a builtin type, and for the same argument written in a variable annotation, a function parameter, a return type, and a struct field. The count follows the types, in the probed shapes: the index program, with one offending argument on each of two types, drew two reports, while two type arguments on one type drew one report naming both. A second code rides along in the probed shape where the same program also uses an unresolved name. Neighboring shapes draw a different code instead: the same extra argument given through a user-defined alias - in the alias's definition and at a use of the alias - to a non-generic struct, and as a turbofish on a non-generic function drew E0107 in the probed shapes, and so did the wrong number of arguments for a generic type and the wrong kind of argument for a generic type. At the boundary, types that declare parameters take their arguments and compile and run - a generic container, a generic alias, and a generic function turbofish - a reference takes its lifetime, the plain corrected forms compile and run, and an argument written in the enum position of an enum variant path also compiled and ran in the probed shapes, even though the index note prefers the argument after the variant. This guide shows the E0109 shapes, the ride-along and neighboring shapes, the boundary, and the repairs.

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

The rule underneath: a type must declare a parameter before it can take an argument

A generic argument in angle brackets is a value supplied for a parameter the named type declares. Vec<i32> works because Vec declares a type parameter and i32 fills it. A builtin type such as u32 or bool declares no parameters at all, so there is nothing for an argument in its angle brackets to fill - not a type argument, not a lifetime argument, and, in the probed shapes, not a const argument either. That mismatch is what E0109 reports, and it is reported where the argument is written: in the probed shapes the same report fired in a type alias, a variable annotation, a function parameter, a return type, and a struct field.

The target's kind decides the code, in the probed shapes. When the target is a builtin type, which is not defined by any item in the program, the code is E0109 and the diagnostic says the argument is not allowed on that builtin type. When the target is an item the program itself defines - an alias, a struct, or a function - the same extra argument drew E0107 instead in the probed shapes, with the diagnostic counting the arguments the item takes against the arguments supplied and pointing at the item's definition. The defect is the same idea in both cases; the code changes with who defines the target.

The honest repairs follow from which side is wrong. If the argument is the mistake, remove it - that is the repair the diagnostic itself draws, striking the argument and leaving the plain type. If the argument is the point - the value really is meant to vary with it - give it to a type that declares a parameter for it, or make the type yours and declare the parameter yourself, as the repairs below show running.

How to read the diagnostic

The E0109 header names the kind of argument and the builtin type it was given to: "type arguments are not allowed on builtin type u32", with "lifetime arguments" and "const arguments" in the same wording for those kinds in the probed shapes. Two spans follow: one underlines the type and labels it "not allowed on builtin type", and one underlines the argument and labels it "type argument not allowed", in the same wording for the argument's kind. A help block then states that the primitive type doesn't have generic parameters and draws the repair as a diff, showing the same line with the argument struck out.

The count follows the types, in the probed shapes - not the arguments. Two type arguments written on one u32 drew exactly one E0109, with both arguments underlined in the single report. The index program's two reports came from two different types, one argument each. Fix every offending type in the output before recompiling to confirm the rest of the program; a second type with the same defect is already reported, not hidden behind the first.

The first failure: the index example

The index's erroneous example, verbatim - one program carrying both halves, a type argument on u32 and a lifetime argument on bool:

Rust
#![allow(unused)]
fn main() {
type X = u32<i32>; // error: type arguments are not allowed for this type
type Y = bool<'static>; // error: lifetime parameters are not allowed on
                        //        this type
}
Output
error[E0109]: type arguments are not allowed on builtin type `u32`
 --> fail_index.rs:3:14
  |
3 | type X = u32<i32>; // error: type arguments are not allowed for this type
  |          --- ^^^ type argument not allowed
  |          |
  |          not allowed on builtin type `u32`
  |
help: primitive type `u32` doesn't have generic parameters
  |
3 - type X = u32<i32>; // error: type arguments are not allowed for this type
3 + type X = u32; // error: type arguments are not allowed for this type
  |

error[E0109]: lifetime arguments are not allowed on builtin type `bool`
 --> fail_index.rs:4:15
  |
4 | type Y = bool<'static>; // error: lifetime parameters are not allowed on
  |          ---- ^^^^^^^ lifetime argument not allowed
  |          |
  |          not allowed on builtin type `bool`
  |
help: primitive type `bool` doesn't have generic parameters
  |
4 - type Y = bool<'static>; // error: lifetime parameters are not allowed on
4 + type Y = bool; // error: lifetime parameters are not allowed on
  |

error: aborting due to 2 previous errors

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

Exactly two E0109 reports and no other error code - one per type, each with its own help diff striking its own argument. Nothing else in the program is wrong: neither alias is ever used. The arguments promise a variation the builtin types cannot take, and the mismatch is in the two type names alone.

Split apart, each half draws the same code on its own. The type-argument half alone:

Output
error[E0109]: type arguments are not allowed on builtin type `u32`
 --> fail_type_arg.rs:3:14
  |
3 | type X = u32<i32>;
  |          --- ^^^ type argument not allowed
  |          |
  |          not allowed on builtin type `u32`
  |
help: primitive type `u32` doesn't have generic parameters
  |
3 - type X = u32<i32>;
3 + type X = u32;
  |

error: aborting due to 1 previous error

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

Exactly one E0109. The lifetime half alone drew exactly one E0109 as well, with the lifetime wording in the header and the span - the full transcript is the fail_index shape's second report, in the file fail_lifetime_arg.rs. The kind of argument changes the wording, not the code: in the probed shapes a type argument on bool drew the same E0109 with the type wording (in the file fail_bool_type_arg.rs), and a const argument on u32 - u32<3> - drew exactly one E0109 with the const wording:

Output
error[E0109]: const arguments are not allowed on builtin type `u32`
 --> fail_const_arg.rs:3:14
  |
3 | type X = u32<3>;
  |          --- ^ const argument not allowed
  |          |
  |          not allowed on builtin type `u32`
  |
help: primitive type `u32` doesn't have generic parameters
  |
3 - type X = u32<3>;
3 + type X = u32;
  |

error: aborting due to 1 previous error

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

The same error in other places

The place the argument is written does not matter, in the probed shapes - only the target does. The same argument in a variable annotation drew exactly one E0109:

Output
error[E0109]: type arguments are not allowed on builtin type `u32`
 --> fail_let_annotation.rs:1:24
  |
1 | fn main() { let x: u32<i32> = 3; println!("{}", x); }
  |                    --- ^^^ type argument not allowed
  |                    |
  |                    not allowed on builtin type `u32`
  |
help: primitive type `u32` doesn't have generic parameters
  |
1 - fn main() { let x: u32<i32> = 3; println!("{}", x); }
1 + fn main() { let x: u32 = 3; println!("{}", x); }
  |

error: aborting due to 1 previous error

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

A function parameter drew exactly one E0109 in the probed shape:

Output
error[E0109]: type arguments are not allowed on builtin type `u32`
 --> fail_fn_param.rs:1:16
  |
1 | fn show(x: u32<i32>) { println!("{}", x); }
  |            --- ^^^ type argument not allowed
  |            |
  |            not allowed on builtin type `u32`
  |
help: primitive type `u32` doesn't have generic parameters
  |
1 - fn show(x: u32<i32>) { println!("{}", x); }
1 + fn show(x: u32) { println!("{}", x); }
  |

error: aborting due to 1 previous error

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

And the same shape in a return type and in a struct field each drew exactly one E0109 in the probed shapes - the full transcripts are the fail_let_annotation shape, one per file, in the files fail_return_type.rs and fail_field_type.rs. Every one of these diagnostics draws the same repair diff: the same line with the argument struck out.

The shape where a second code rides along

Other errors in the same program are reported alongside E0109. A program whose offending alias shared the file with an unresolved name in the entry point drew E0425 and E0109 together in the probed shape, ending with "aborting due to 2 previous errors":

Output
error[E0425]: cannot find value `missing_name` in this scope
 --> ride_unresolved.rs:2:28
  |
2 | fn main() { println!("{}", missing_name); }
  |                            ^^^^^^^^^^^^ not found in this scope

error[E0109]: type arguments are not allowed on builtin type `u32`
 --> ride_unresolved.rs:1:14
  |
1 | type X = u32<i32>;
  |          --- ^^^ type argument not allowed
  |          |
  |          not allowed on builtin type `u32`
  |
help: primitive type `u32` doesn't have generic parameters
  |
1 - type X = u32<i32>;
1 + type X = u32;
  |

error: aborting due to 2 previous errors

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

Removing the argument clears the E0109 in that shape and leaves the E0425 standing - the unresolved name is a separate problem that happens to share the output.

The shapes that are not this error

Give the same extra argument to a type the program itself defines, and the code changes. An alias for a plain builtin type, given an argument in a second alias's definition, drew exactly one E0107 in the probed shape - not E0109:

Output
error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
 --> fail_alias_definition.rs:2:10
  |
2 | type X = Plain<i32>;
  |          ^^^^^----- help: remove the unnecessary generics
  |          |
  |          expected 0 generic arguments
  |
note: type alias defined here, with 0 generic parameters
 --> fail_alias_definition.rs:1:6
  |
1 | type Plain = u32;
  |      ^^^^^

error: aborting due to 1 previous error

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

The same argument at a use of that alias - a variable annotated with the alias and an argument - drew exactly one E0107 in the probed shape, with the same counting wording and the same note pointing at the alias's definition. A non-generic struct given an argument drew exactly one E0107 in the probed shape, and a turbofish argument on a non-generic function drew exactly one E0107 too - the full transcripts are the fail_alias_definition shape under the other items' names, in the files fail_alias_use.rs, fail_struct_nongeneric.rs, and fail_fn_turbofish.rs. The line between the two codes, in the probed shapes, is who defines the target: a builtin type draws E0109, and an item defined in the program draws E0107.

A generic target given the wrong count is the same neighboring code. A generic struct defined in the program, given two arguments for its one parameter, drew exactly one E0107 in the probed shape:

Output
error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
 --> neighbour_wrong_count_own.rs:2:20
  |
2 | fn main() { let x: G<i32, i32> = G { v: 3 }; println!("{}", x.v); }
  |                    ^    ----- help: remove the unnecessary generic argument
  |                    |
  |                    expected 1 generic argument
  |
note: struct defined here, with 1 generic parameter: `T`
 --> neighbour_wrong_count_own.rs:1:8
  |
1 | struct G<T> { v: T }
  |        ^ -

error: aborting due to 1 previous error

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

A generic type given an argument of the wrong kind drew E0107 as well in the probed shape: a lifetime argument on Vec, which takes a type argument, drew two E0107 reports - one for the lifetime it takes none of, and one for the type argument still missing. And one probed shape left both codes behind: an extra argument on Vec itself drew E0658, because Vec's second parameter is an unstable allocator parameter, so that shape is an unstable-feature report rather than a count report. A tuple type given an argument in the probed shape drew no error code at all - the line was a parse error, because an argument list cannot follow a tuple type in that position.

The index note's variant shape is the other surprise. The index advises writing generic arguments for an enum variant constructor after the variant - Option::None::<u32> - rather than after the enum. In the probed shapes, the after-the-enum form compiled and ran anyway: Option::<u32>::None printed None, and Option::<u32>::Some(3) printed Some(3). The variant-position form the index prefers is shown running in the boundary and the repairs; on this compiler, in these shapes, the enum position is not an E0109.

The boundary: targets that take their arguments

The line is whether the named type declares a parameter for the argument, and on the other side of it the same angle brackets are ordinary code. A generic container takes its type argument: a vector of i32 built through Vec<i32> compiled and ran in the probed shape, printing 3, the length of the vector. A generic function takes its turbofish: a generic identity function called as id::<i32>(3) compiled and ran in the probed shape, printing 3.

A generic alias takes its argument the same way - the indirect form is fine when the alias declares the parameter. An alias for a vector of its parameter, used with an argument, compiled and ran in the probed shape, printing 2:

Rust
type G<T> = Vec<T>;
fn main() { let x: G<i32> = vec![4, 5]; println!("{}", x.len()); }
Output
2

A lifetime in its proper place is not an argument on a parameterless type. A reference type takes its lifetime as part of the reference itself: a &'static u32 compiled and ran in the probed shape, printing 3, the value behind the reference.

The index's own corrected forms compile and run. The two aliases with their arguments removed, used for a plain integer and a plain boolean, printed 3 true in the probed shape - the values the program built through them.

And the variant-position turbofish the index recommends compiles and runs in the probed shape, printing None:

Rust
fn main() { let x = Option::None::<u32>; println!("{:?}", x); }
Output
None

For an extra, missing, or wrongly counted argument on a type, alias, struct, or function the program defines, the neighboring code is E0107. For an unresolved name used in the same program, the neighboring code is E0425.

The repairs

Every repair below starts from the same observation: the named type declares no parameter for the argument written on it. Either take the argument off the type, or put the argument on a type that declares a parameter - one from the library, or one of your own that you make generic.

Remove the argument. Dropping the argument from the annotation compiled and ran in the probed shape, printing 3 - the value was a plain u32 all along, which is what the type name said without the brackets:

Rust
fn main() { let x: u32 = 3; println!("{}", x); }
Output
3

The index's corrected aliases are the same repair at the definition: both aliases with no arguments compiled and ran in the probed shape, printing 3 true.

Give the argument to a type that takes it. If the argument was the point - the value really is a collection of i32, not a single i32 - changing the target to a generic type that declares the parameter compiled and ran in the probed shape, printing 2, the length of the vector built through the alias:

Rust
type X = Vec<i32>;
fn main() { let x: X = vec![7, 8]; println!("{}", x.len()); }
Output
2

Make your own type generic. If the name is yours - an alias you control - declaring the parameter on it and building the aliased type from it compiled and ran in the probed shape, printing 9, the element the program read back through the alias:

Rust
type X<T> = Vec<T>;
fn main() { let x: X<i32> = vec![9]; println!("{}", x[0]); }
Output
9

Put the variant's argument after the variant. For an enum variant constructor, the form the index recommends - the argument after the variant name, in a program that also names the enum with its argument as the variable's type - compiled and ran in the probed shape, printing None:

Rust
fn main() { let x: Option<u32> = Option::None::<u32>; println!("{:?}", x); }
Output
None

In the probed shapes the after-the-enum form compiled and ran too, so this repair is the index's preferred form rather than the only form this compiler accepts - use it because it is the documented form, and because it names the variant the argument belongs to.

Fixes in reach order

First, read the spans. The underlined type is the one that takes no argument, and the underlined argument is the one with nowhere to go. That pair is the whole diagnosis - no other part of the program needs to change for a pure E0109.

Second, decide whether the argument was the mistake. If the value is just the plain type, remove the argument - and remove it in the diagnostic's own diff form, leaving the type name standing alone.

Third, if the argument was the point, move it to a type that declares a parameter for it: a generic container or another generic library type, as in the vector repair above. Do not move it onto another parameterless type instead - in the probed shapes that only repeats the same report under the new type's name.

Fourth, if the name is your own alias and it is meant to vary, declare the parameter on the alias and build its body from it. If the name is your own alias, struct, or function and it is not meant to vary, the report will be E0107 rather than E0109 in the probed shapes - the repair is the same removal, under the neighboring code.

Fifth, for an enum variant constructor, write the argument after the variant, the documented form. In the probed shapes the after-the-enum form also compiled and ran, so treat this as following the index's form, not as escaping an error this compiler raises for these shapes.

Sixth, if the output also carries a second code, fix that shape on its own terms after the E0109 is gone: an unresolved name elsewhere in the program stays an E0425, and an argument on a type the program defines is an E0107 with the same removal repair under the other code.

Decision summary

E0109 fired on its own in the probed shapes for the index example (exactly two E0109 reports, one per type, and no other code), for the type-argument half alone and the lifetime half alone (exactly one E0109 each), for a type argument on bool, for a const argument on u32, and for the same argument in a variable annotation, a function parameter, a return type, and a struct field (exactly one E0109 each). Two type arguments on one u32 drew exactly one E0109 naming both arguments. It rode along with E0425 for an unresolved name elsewhere in the program, in the probed shapes. It did not fire, in the probed shapes, for a generic container taking its type argument (compiled and ran, printing 3), for a generic alias taking its argument (compiled and ran, printing 2), for a generic function taking its turbofish (compiled and ran, printing 3), for a reference taking its lifetime (compiled and ran, printing 3), for the index's corrected plain aliases (compiled and ran, printing 3 true), or for an argument in the enum position of an enum variant path (compiled and ran, printing None for the empty variant and Some(3) for the filled variant). The neighboring shapes drew other output instead in the probed shapes: an argument given through a user-defined alias in its definition and at its use, an argument on a non-generic struct, and a turbofish on a non-generic function each drew exactly one E0107; a wrong argument count on a generic struct the program defines drew exactly one E0107; a lifetime argument on Vec drew two E0107 reports; an extra argument on Vec drew E0658; a tuple type given an argument drew a parse error with no error code. The repairs that compiled and ran in the probed shapes were removing the argument (printing 3, and 3 true for the index's corrected aliases), giving the argument to a type that takes it (printing 2), making the guide's own alias generic (printing 9), and writing the variant's argument after the variant (printing None).

Checklist

  • The target is the test, in the probed shapes: an argument in angle brackets needs a parameter on the named type to fill, and a builtin type has none - of any kind.
  • The kind changes the wording, not the code, in the probed shapes: type, lifetime, and const arguments on a builtin type each drew E0109.
  • The count is per type, in the probed shapes: two arguments on one type drew one report, and one argument on each of two types drew two.
  • The definer decides the code, in the probed shapes: a builtin target drew E0109, and an alias, struct, or function defined in the program drew E0107 for the same extra argument.
  • The place does not matter, in the probed shapes: an alias, an annotation, a parameter, a return type, and a field drew the same report for the same argument on the same builtin type.
  • On the other side of the line there is no error, in the probed shapes: a target that declares the parameter - a container, a generic alias, a generic function, a reference's lifetime - takes its argument and runs.

Sources

  • Rust error codes index, E0109 - a generic argument was provided to a type which doesn't need it; the erroneous example gives a type argument to u32 and a lifetime argument to bool, the advice is to check the correct argument and the definition, the corrected example removes both arguments, and a note says generic arguments for enum variant constructors go after the variant, not after the enum.
  • Rust error codes index, E0107 - an incorrect number of generic arguments was provided; the neighboring code drawn in the probed shapes by an extra argument on an alias, struct, or function the program defines, and by a wrong count or wrong kind of argument on a generic type.
  • Rust error codes index, E0425 - an unresolved name was used; the neighboring code drawn in the probed shape alongside E0109 by a program that also used an unresolved name.
  • The Rust Reference, Generic parameters - items may declare type, lifetime, and const parameters, and an argument in angle brackets supplies a value for a declared parameter.

Keep Exploring