Skip to content

Commit e372ad4

Browse files
committed
Expand the documentation for E0747
1 parent 76fb26b commit e372ad4

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/librustc_error_codes/error_codes/E0747.md

+9
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ struct S<'a, T>(&'a T);
99
type X = S<(), 'static>; // error: the type argument is provided before the
1010
// lifetime argument
1111
```
12+
13+
The argument order should be changed to match the parameter declaration
14+
order, as in the following.
15+
16+
```
17+
struct S<'a, T>(&'a T);
18+
19+
type X = S<'static, ()>; // ok
20+
```

src/test/ui/const-generics/const-param-after-const-literal-arg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// check-pass
22

3+
#![allow(incomplete_features)]
34
#![feature(const_generics)]
4-
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
55

66
struct Foo<const A: usize, const B: usize>;
77

src/test/ui/const-generics/const-param-after-const-literal-arg.stderr

-8
This file was deleted.

src/test/ui/const-generics/const-param-before-other-params.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
#![allow(incomplete_features)]
12
#![feature(const_generics)]
2-
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
33

44
fn bar<const X: (), 'a>(_: &'a ()) {
55
//~^ ERROR lifetime parameters must be declared prior to const parameters

0 commit comments

Comments
 (0)