blob: 9514c7dac6bdf5d5990c5ee7f0f53252f19fd62b [file] [view]
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.
Erroneous code example:
```compile_fail,E0747
struct S<'a, T>(&'a T);
type X = S<(), 'static>; // error: the type argument is provided before the
// lifetime argument
```
The argument order should be changed to match the parameter declaration
order, as in the following:
```
struct S<'a, T>(&'a T);
type X = S<'static, ()>; // ok
```
Another erroneous code example:
```compile_fail,E0747
struct Foo<const N: usize>;
fn foo() -> Foo<usize> {} // error: type provided when a constant was
// expected
```
A constant expression must be provided when a constant generic parameter
is declared, not a type, as in the following:
```
struct Foo<const N: usize>;
fn foo() -> Foo<3> { Foo }
```