Rust

E0747 Generic Argument Order Fix

E0747 is a position error, not a count error. The arguments in the angle brackets are matched to the parameters one slot at a time, in declaration order, and each slot accepts only its own kind: a lifetime slot takes a lifetime, a type slot takes a type, a const slot takes a constant. Put a type where the lifetime is declared, or a constant where the type is declared, and the compiler stops at that slot - even when every argument you supplied belongs to the item, just in the wrong place. The neighboring count error, E0107, looks similar and is easy to reach for first, but it answers a different question: how many arguments of each kind, not which slot each one landed in. This guide works the shapes that produce E0747, shows the reordered repairs running, and separates the shapes that carry different codes instead.

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

By the end of this guide
  • The rule underneath: slots, kinds, and declaration order
  • How to read the diagnostic
  • The first failures: a type in the lifetime slot
  • The kind failures: types and constants in each other's slots

Written November 30, 2026

Tested with Rust 1.99.0

What this guide is

Error E0747 is about the order and kind of generic arguments. The error codes index opens: "Generic arguments were not provided in the same order as the corresponding generic parameters are declared, or a type was provided when a constant was expected." Generic arguments are positional: the first argument goes to the first declared parameter, the second to the second, and so on, and an argument of the wrong kind for its slot - a type in a lifetime slot, a type in a const slot, a constant in a type slot - is this error.

The practical payoff is the split from the neighboring count error. E0107 is about how many arguments were supplied: too many, or too few, of a kind. E0747 is about which slot each argument landed in, and in this guide's probed set the two divide cleanly: when the count of each kind is right but an argument sits in a slot of another kind, the code is E0747; when a kind's count itself is wrong - most often a lifetime supplied to an item that declares no lifetime parameter at all - the code is E0107 instead. A third neighbor sits on the declaration side: E0087 is about an item declaring too many type parameters, not about the arguments supplied to it. E0747 is judged entirely at the use site, against the declaration as written.

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: slots, kinds, and declaration order

Three kinds of generic parameter exist - lifetimes, types, and constants - and the declaration fixes both their order and their kinds. The Rust Reference's generic parameters page states the declaration-side restriction: "The order of generic parameters is restricted to lifetime parameters and then type and const parameters intermixed." Lifetimes always come first in a declaration; type and const parameters follow in whichever order the item declares them, which is why a const slot can sit before a type slot in one item and after it in another.

The argument side has its own ordering. The Reference's paths page states: "The order of generic arguments is restricted to lifetime arguments, then type arguments, then const arguments, then equality constraints." Equality constraints are the associated-type bindings (Item = u8 and similar), and they come last, after every positional argument. Within the positional arguments, matching is slot by slot against the declaration: the argument in position one is checked against the parameter declared first, and in the probed set a mismatch of the three forms this guide works - a type in a lifetime slot, a type in a const slot, or a constant in a type slot - is E0747, regardless of whether the same argument would have been correct one slot later.

Two consequences follow, and both are visible in the failures below. First, there are no named positional arguments: you cannot label a type argument with its parameter's name to place it out of order - the only named form is the associated-type binding, and bindings belong at the end. Second, parameters with defaults still occupy their slots when you do supply arguments, but a defaulted parameter may simply be left off the end, as the controls show - omission from the tail is not an order error.

How to read the diagnostic

Every E0747 failure in the probed set is a single error with a one-line header naming the two kinds involved, in the form "X provided when a Y was expected". Three forms occur: "type provided when a lifetime was expected", "type provided when a constant was expected", and "constant provided when a type was expected". The span underlines the single argument in the wrong slot - not the whole argument list - so the underlined argument and the header together tell you which slot to fix: the underline is the argument to move or replace, and the header's second kind is the kind that slot declares. There are no notes and no "aborting due to" second error in the clean cases below; where a second error does appear in this guide, it belongs to a neighbor, not to E0747.

One help text deserves suspicion. For a type supplied to a const slot, the compiler suggests surrounding the type with braces, as if it were intended as a const expression. In the probed case that suggestion does not repair the program - the slot wants a constant value, not a braced type - and the working repair is to supply a constant, as the fixes show. Read the help as the compiler's guess about intent, and the header as the fact.

The first failures: a type in the lifetime slot

The error index's own example is the smallest shape: a struct declaring a lifetime parameter first and a type parameter second, used with the two arguments swapped. Written as a type alias:

Rust
struct S<'a, T>(&'a T);
type X = S<(), 'static>;
fn main() {}
Output
error[E0747]: type provided when a lifetime was expected
 --> p1.rs:2:12
  |
2 | type X = S<(), 'static>;
  |            ^^

error: aborting due to 1 previous error

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

The count of each kind is exactly right - one lifetime's worth of arguments is not the problem; () is a type sitting in the 'a slot, and 'static is left to fill the type slot behind it. The same swap in a struct annotation inside a function body, where the value being annotated is otherwise correct, produces the identical diagnostic at the annotation:

Rust
struct S<'a, T>(&'a T);
static UNIT: () = ();
fn main() {
    let _s: S<(), 'static> = S(&UNIT);
}
Output
error[E0747]: type provided when a lifetime was expected
 --> p6.rs:4:15
  |
4 |     let _s: S<(), 'static> = S(&UNIT);
  |               ^^

error: aborting due to 1 previous error

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

The position of the use does not matter, only the position of the argument. The same swapped pair in a constructor turbofish - the ::<> form used in expressions - fails the same way:

Rust
struct S<'a, T>(&'a T);
static UNIT: () = ();
fn main() {
    let _s = S::<(), 'static>(&UNIT);
}
Output
error[E0747]: type provided when a lifetime was expected
 --> p12.rs:4:18
  |
4 |     let _s = S::<(), 'static>(&UNIT);
  |                  ^^

error: aborting due to 1 previous error

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

An implementation header is another use site with the same rule. A trait declaring a lifetime parameter and then a type parameter, implemented with the arguments swapped, fails at the first argument:

Rust
trait Tr<'a, T> {}
struct Impl;
impl Tr<u8, 'static> for Impl {}
fn main() {}
Output
error[E0747]: type provided when a lifetime was expected
 --> p8.rs:3:9
  |
3 | impl Tr<u8, 'static> for Impl {}
  |         ^^

error: aborting due to 1 previous error

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

And the swap can hide inside another item's definition: a type alias whose own parameters are declared in the right order, but whose right-hand side passes them to the target struct in the wrong order:

Rust
struct S<'a, T>(&'a T);
type Bad<'a, T> = S<T, 'a>;
fn main() {}
Output
error[E0747]: type provided when a lifetime was expected
 --> p9.rs:2:21
  |
2 | type Bad<'a, T> = S<T, 'a>;
  |                     ^

error: aborting due to 1 previous error

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

In all five shapes the repair is the same motion: put the lifetime argument back in the first slot and the type argument behind it, matching the declaration. The repairs are collected at the end of this guide.

The kind failures: types and constants in each other's slots

The second family swaps kinds rather than positions of the same pair: a type where a constant is declared, or a constant where a type is declared. The error index's second example is the first of these - a struct with a single const parameter, given a type:

Rust
struct Foo<const N: usize>;
type Y = Foo<usize>;
fn main() {}
Output
error[E0747]: type provided when a constant was expected
 --> p2.rs:2:14
  |
2 | type Y = Foo<usize>;
  |              ^^^^^
  |
help: if this generic argument was intended as a const parameter, surround it with braces
  |
2 | type Y = Foo<{ usize }>;
  |              +       +

error: aborting due to 1 previous error

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

Note what the index example makes plain: an item does not need two parameters for E0747 to fire. A single slot of the wrong kind is enough, because the check is per slot, not a permutation check. The reverse direction - a constant supplied where a type is declared - fires with the mirrored header:

Rust
struct Bar<T>(T);
type Z = Bar<3>;
fn main() {}
Output
error[E0747]: constant provided when a type was expected
 --> p3.rs:2:14
  |
2 | type Z = Bar<3>;
  |              ^

error: aborting due to 1 previous error

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

When an item declares both a type parameter and a const parameter, the declaration order between them is the item's own choice, and the arguments must follow it. This struct declares the type first and the const second; supplying them the other way round puts the constant in the type slot:

Rust
struct Pair<T, const N: usize>([T; N]);
type P = Pair<3, u8>;
fn main() {}
Output
error[E0747]: constant provided when a type was expected
 --> p10.rs:2:15
  |
2 | type P = Pair<3, u8>;
  |               ^

error: aborting due to 1 previous error

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

The same two-slot swap in a function turbofish - a function declaring a type parameter and then a const parameter, called with the constant first - produces the same header at the call site:

Rust
fn f<T, const N: usize>() -> usize { N }
fn main() {
    let _n = f::<3, u8>();
}
Output
error[E0747]: constant provided when a type was expected
 --> p13.rs:3:18
  |
3 |     let _n = f::<3, u8>();
  |                  ^

error: aborting due to 1 previous error

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

Across this family the pattern is constant: the header names the kind supplied and the kind expected at the underlined slot, and no other error is reported. The argument list is not rejected as a whole; the first wrong slot is.

What is allowed: the controls

The error index's corrected form of its first example - the same alias with the arguments in declaration order - compiles:

Rust
struct S<'a, T>(&'a T);
type X = S<'static, ()>;
fn main() {}

This program compiles in the probed set. Nothing else about the program changed: the same struct, the same two arguments, the same alias. Order alone is the difference between this control and the first failure.

A const slot given a constant compiles and runs. The const-correct counterpart of the type-for-const failure, with the constant read back through an impl:

Rust
struct Foo<const N: usize>;
impl<const N: usize> Foo<N> {
    fn size(&self) -> usize { N }
}
fn main() {
    let f: Foo<3> = Foo;
    println!("{}", f.size());
}
Output
3

The output is 3, the constant supplied in the slot. A const argument that is a plain literal needs no braces; per the Reference's paths page, const arguments must be surrounded by braces only when they are not a literal, an inferred const, or a single segment path.

Defaulted parameters may be omitted from the tail. Both structs below declare parameters with defaults - a type default on the first, and a type default plus a const default on the second - and both are used with the defaulted slots left off entirely:

Rust
struct D<'a, T = u8>(&'a T);
struct E<T = u8, const N: usize = 4>([T; N]);
static NINE: u8 = 9;
fn main() {
    let _d: D<'static> = D(&NINE);
    let _e: E = E([1u8, 2, 3, 4]);
    println!("ok");
}
Output
ok

The output is ok. Omission works from the end: the lifetime, which has no default and is declared first, is supplied, and everything after it falls back to its default. What omission does not let you do is skip a middle slot - arguments are matched from the first slot forward, so supplying a later argument while skipping an earlier defaulted one still places it in the earlier slot.

Last, an associated-type binding placed after the positional arguments - its required position - compiles and runs:

Rust
trait Tr<T> { type Item; }
struct Impl;
impl Tr<u8> for Impl { type Item = u16; }
fn takes(_x: Box<dyn Tr<u8, Item = u16>>) {}
fn main() {
    takes(Box::new(Impl));
    println!("ok");
}
Output
ok

The output is ok. The binding Item = u16 names an associated type, not a parameter, and it follows the one positional argument. The trap section shows what happens when the binding is moved in front of it.

The traps: neighbors that are not E0747

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

A lifetime supplied to an item that declares no lifetime parameter at all is not E0747 - it is the count error, E0107, reported per kind. A struct with a single type parameter, given a lifetime:

Rust
struct Only<T>(T);
type W = Only<'static>;
fn main() {}
Output
error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
 --> p4.rs:2:10
  |
2 | type W = Only<'static>;
  |          ^^^^--------- help: remove the unnecessary generics
  |          |
  |          expected 0 lifetime arguments
  |
note: struct defined here, with 0 lifetime parameters
 --> p4.rs:1:8
  |
1 | struct Only<T>(T);
  |        ^^^^

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
 --> p4.rs:2:10
  |
2 | type W = Only<'static>;
  |          ^^^^ expected 1 generic argument
  |
note: struct defined here, with 1 generic parameter: `T`
 --> p4.rs:1:8
  |
1 | struct Only<T>(T);
  |        ^^^^ -
help: add missing generic argument
  |
2 | type W = Only<'static, T>;
  |                      +++

error: aborting due to 2 previous errors

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

Two E0107 errors are reported: the struct takes 0 lifetime arguments but 1 was supplied, and it takes 1 generic argument but 0 were supplied. The same shape against a const-only struct - a lifetime supplied where the item declares only a const parameter - reports the same pair of counts:

Rust
struct Foo<const N: usize>;
type Y = Foo<'static>;
fn main() {}
Output
error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
 --> p11.rs:2:10
  |
2 | type Y = Foo<'static>;
  |          ^^^--------- help: remove the unnecessary generics
  |          |
  |          expected 0 lifetime arguments
  |
note: struct defined here, with 0 lifetime parameters
 --> p11.rs:1:8
  |
1 | struct Foo<const N: usize>;
  |        ^^^

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
 --> p11.rs:2:10
  |
2 | type Y = Foo<'static>;
  |          ^^^ expected 1 generic argument
  |
note: struct defined here, with 1 generic parameter: `N`
 --> p11.rs:1:8
  |
1 | struct Foo<const N: usize>;
  |        ^^^ --------------
help: add missing generic argument
  |
2 | type Y = Foo<'static, N>;
  |                     +++

error: aborting due to 2 previous errors

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

The dividing line in the probed set is whether each kind's count is right. In the E0747 failures the item declares a parameter of the expected kind and the argument merely lands in the wrong slot; here the item declares no lifetime parameter at all, so the lifetime argument is a surplus of its kind, and surplus and shortage are E0107's territory. The pure count cases make the same point without any kind confusion - too many type arguments for a one-parameter struct:

Rust
struct One<T>(T);
type Too = One<u8, u16>;
fn main() {}
Output
error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
 --> n1.rs:2:12
  |
2 | type Too = One<u8, u16>;
  |            ^^^   ----- help: remove the unnecessary generic argument
  |            |
  |            expected 1 generic argument
  |
note: struct defined here, with 1 generic parameter: `T`
 --> n1.rs:1:8
  |
1 | struct One<T>(T);
  |        ^^^ -

error: aborting due to 1 previous error

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

and too few in a function turbofish:

Rust
fn g<T, U>() {}
fn main() {
    g::<u8>();
}
Output
error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
 --> n2.rs:3:5
  |
3 |     g::<u8>();
  |     ^   -- supplied 1 generic argument
  |     |
  |     expected 2 generic arguments
  |
note: function defined here, with 2 generic parameters: `T`, `U`
 --> n2.rs:1:4
  |
1 | fn g<T, U>() {}
  |    ^ -  -
help: add missing generic argument
  |
3 |     g::<u8, U>();
  |           +++

error: aborting due to 1 previous error

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

Supplying a type to an item that declares only a lifetime parameter lands on the same side of the line, with an additional error. The struct declares one lifetime parameter and no type parameters; giving it a type reports the type as a surplus generic argument under E0107, and the lifetime that was never supplied as missing under E0106:

Rust
struct L<'a>(&'a u8);
type V = L<u8>;
fn main() {}
Output
error[E0106]: missing lifetime specifier
 --> p5.rs:2:11
  |
2 | type V = L<u8>;
  |           ^ expected named lifetime parameter
  |
help: consider introducing a named lifetime parameter
  |
2 | type V<'a> = L<'a, u8>;
  |       ++++     +++

error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
 --> p5.rs:2:10
  |
2 | type V = L<u8>;
  |          ^ -- help: remove the unnecessary generic argument
  |          |
  |          expected 0 generic arguments
  |
note: struct defined here, with 0 generic parameters
 --> p5.rs:1:8
  |
1 | struct L<'a>(&'a u8);
  |        ^

error: aborting due to 2 previous errors

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

Contrast the first failure in this guide: there the item declared both kinds and the counts per kind were right, so the swapped pair was E0747. Here the counts per kind are wrong, so the codes are the count and missing-lifetime codes. When the diagnostic says "takes N ... but M were supplied", fix the count; when it says "provided when a ... was expected", fix the slot.

A function turbofish has one position that cannot be filled explicitly at all. A lifetime that is late bound - one that appears only in the function's argument types - may not be given as an explicit turbofish argument, in any order. Supplying it, even as the second argument behind the type, stops before any order check with E0794:

Rust
fn pick<'a, T>(x: &'a T) -> &'a T { x }
fn main() {
    let n = 5u8;
    let _r = pick::<u8, 'static>(&n);
}
Output
error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
 --> p7.rs:4:21
  |
4 |     let _r = pick::<u8, 'static>(&n);
  |                     ^^
  |
note: the late bound lifetime parameter is introduced here
 --> p7.rs:1:9
  |
1 | fn pick<'a, T>(x: &'a T) -> &'a T { x }
  |         ^^

error: aborting due to 1 previous error

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

This is not an invitation to reorder: the same call with the lifetime first fails the same way, because the restriction is on naming a late-bound lifetime explicitly at all. Leave the lifetime to inference - call the function without it in the turbofish - or, when every argument must be explicit, use a position where lifetimes are not late bound, such as a struct constructor turbofish, as the controls and repairs do. (Naming the wrong associated type, a different explicitness problem, is E0223.)

Last, an associated-type binding placed before the positional arguments is an ordering error, but not E0747 - it carries no error code at all. The trait below takes one type parameter and has one associated type; writing the binding first and the positional argument after it:

Rust
trait Tr<T> { type Item; }
struct Impl;
impl Tr<u8> for Impl { type Item = u16; }
fn main() {
    let _x: Box<dyn Tr<Item = u16, u8>> = Box::new(Impl);
}
Output
error: generic arguments must come before the first constraint
 --> p14.rs:5:36
  |
5 |     let _x: Box<dyn Tr<Item = u16, u8>> = Box::new(Impl);
  |                        ----------  ^^ generic argument
  |                        |
  |                        constraint
  |
help: move the constraint after the generic argument
  |
5 -     let _x: Box<dyn Tr<Item = u16, u8>> = Box::new(Impl);
5 +     let _x: Box<dyn Tr<u8, Item = u16>> = Box::new(Impl);
  |

error: aborting due to 1 previous error

The message states the rule directly - "generic arguments must come before the first constraint" - and its help performs the repair, moving the binding behind the positional argument. This matches the Reference's argument order: positional arguments first, equality constraints last. E0747 governs the positional slots; the binding's position has its own, uncoded diagnostic.

Fixes in reach order

First, reorder the arguments to declaration order. The first failure of this guide, with the lifetime argument restored to the first slot and the type argument behind it, compiles and runs:

Rust
struct S<'a, T>(&'a T);
type X = S<'static, u8>;
static N: u8 = 42;
fn main() {
    let s: X = S(&N);
    println!("{}", s.0);
}
Output
42

The output is 42, the value behind the reference the struct holds. The same motion repairs the implementation header - the swapped impl from the failures, reordered:

Rust
trait Tr<'a, T> {}
struct Impl;
impl Tr<'static, u8> for Impl {}
fn main() {
    println!("ok");
}
Output
ok

The output is ok. And it repairs the function turbofish from the kind failures - the type argument first, the constant second, as declared:

Rust
fn f<T, const N: usize>() -> usize { N }
fn main() {
    let n = f::<u8, 3>();
    println!("{}", n);
}
Output
3

The output is 3, the constant the function returns. In each case nothing but the argument order changed; the declarations were already the order the arguments needed to follow.

Second, when the slot's kind is wrong rather than the order, replace the argument with one of the slot's kind. The type-for-const failure is repaired by supplying the constant the slot declares - the error index's own corrected form:

Rust
struct Foo<const N: usize>;
fn foo() -> Foo<3> { Foo }
fn main() {
    let _f = foo();
    println!("ok");
}
Output
ok

The output is ok. And the const-before-type failure is repaired by giving the type slot a type and the const slot its constant, in declaration order:

Rust
struct Pair<T, const N: usize>([T; N]);
fn main() {
    let p: Pair<u8, 3> = Pair([7, 8, 9]);
    println!("{}", p.0[1]);
}
Output
8

The output is 8, the middle element of the array the struct holds. The two repairs are the same habit seen from two sides: read the declaration left to right, and fill each slot with an argument of that slot's kind, in that order.

Third, when the diagnostic is a count diagnostic, switch playbooks: E0107 means a kind has too many or too few arguments - remove the surplus or supply the missing ones, as the E0107 guide works through - and E0106 alongside it means a lifetime the item declares was never supplied. Reordering cannot fix a count, and in the probed set every count-shaped failure above carried those codes rather than E0747, however order-like the mistake felt.

Last, keep bindings last and late-bound lifetimes unnamed: an associated-type binding goes after every positional argument (the binding-after-positional control above is this repair applied to the binding trap), and a late-bound function lifetime is left to inference rather than written into a turbofish in either order.

Decision summary

E0747, in this guide's probed set, fired exactly when an argument landed in a slot of a different kind while the count of each kind was right: a type in a lifetime slot (a type alias, a struct annotation, a constructor turbofish, an impl header, and an alias's right-hand side), a type in a const slot, and a constant in a type slot (a struct use and a function turbofish). It did not fire when a kind's count itself was wrong: a lifetime supplied to an item declaring no lifetime parameter was E0107 twice over, a type supplied to a lifetime-only item was E0107 with E0106, and plain too-many and too-few argument counts were E0107. Two ordering problems carry other diagnostics entirely: an explicitly named late-bound lifetime in a function turbofish is E0794, and an associated-type binding placed before the positional arguments is an uncoded "generic arguments must come before the first constraint" error. The repairs act on the use site only: reorder the arguments to declaration order, give each slot an argument of its own kind, leave defaulted tail parameters omitted, place bindings last, and leave late-bound lifetimes to inference.

Checklist

  • Read the header's two kinds first: in the probed set, "X provided when a Y was expected" is E0747 and names the supplied kind and the slot's kind; "takes N but M were supplied" is E0107 and is a count problem, not an order problem.
  • Fix the underlined slot, not the whole list: in the probed set, the span marks the single argument in the wrong slot, and the remaining arguments may already be correct.
  • Read the declaration left to right and fill slots in that order: lifetimes first, then type and const parameters in the item's own declared order - a const slot can precede a type slot when the item declares it that way.
  • Do not trust the braces help for a type in a const slot: in the probed set, the slot wanted a constant value, and supplying one - not bracing the type - was the repair.
  • Omit only from the tail: in the probed set, defaulted parameters left off the end compiled, and supplied arguments are always matched from the first slot forward.
  • Keep associated-type bindings after all positional arguments, and do not name a late-bound lifetime in a function turbofish in either order: in the probed set, the first was an uncoded ordering error and the second was E0794.

Sources

  • Rust error codes index, E0747 - generic arguments were not provided in the same order as the corresponding generic parameters are declared, or a type was provided when a constant was expected; the erroneous example S<(), 'static> against struct S<'a, T>, corrected to S<'static, ()> by changing the argument order to match the parameter declaration order; the second erroneous example Foo<usize> against struct Foo<const N: usize>, corrected by providing a constant expression, Foo<3>, because a constant expression must be provided when a constant generic parameter is declared, not a type.
  • Rust error codes index, E0107 - the neighboring count code: an incorrect number of generic arguments was provided; when using or declaring an item with generic arguments, you must provide the exact same number; its examples of too few and too many type arguments and of a lifetime argument supplied to a function declaring no lifetime parameters.
  • The Rust Reference, Paths - the order of generic arguments is restricted to lifetime arguments, then type arguments, then const arguments, then equality constraints; const arguments must be surrounded by braces unless they are a literal, an inferred const, or a single segment path; the :: token before the opening < in expression paths, colloquially known as turbofish syntax.
  • The Rust Reference, Generic parameters - functions, type aliases, structs, enumerations, unions, traits, and implementations may be parameterized by types, constants, and lifetimes; the order of generic parameters is restricted to lifetime parameters and then type and const parameters intermixed; the allowed types of const parameters; a const argument in a path specifies the const value to use for that item.

Keep Exploring