Skip to content

Commit 9c0b9c3

Browse files
authored
reflect that type and const parameter can be intermixed
Also, add reference id
1 parent 292db4a commit 9c0b9c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
struct Bad<const N: usize, T> {
1+
//@ reference: items.generics.syntax.decl-order
2+
3+
struct Good<const N: usize, T> {
24
arr: [u8; { N }],
35
another: T,
46
}
57

6-
struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
8+
struct Bad<const N: usize, 'a, T, 'b, const M: usize, U> {
79
//~^ ERROR lifetime parameters must be declared prior
810
a: &'a T,
911
b: &'b U,
1012
}
1113

1214
fn main() {
13-
let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
15+
let _: Bad<7, 'static, u32, 'static, 17, u16>;
1416
//~^ ERROR lifetime provided when a type was expected
1517
}

0 commit comments

Comments
 (0)