Skip to content

Commit 907ba75

Browse files
committed
update min_const_generics tests using default values for const params
The `const_generics_defaults` now handles them, and they correctly parse, so we can update these tests expecting a parser error .
1 parent 64244b2 commit 907ba75

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn foo<const SIZE: usize = 5>() {}
2-
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2+
//~^ ERROR default values for const generic parameters are unstable
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2-
--> $DIR/default_function_param.rs:1:26
1+
error: default values for const generic parameters are unstable
2+
--> $DIR/default_function_param.rs:1:28
33
|
44
LL | fn foo<const SIZE: usize = 5>() {}
5-
| ^ expected one of 7 possible tokens
5+
| ^
6+
|
7+
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
68

79
error: aborting due to previous error
810

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
trait Foo<const KIND: bool = true> {}
2-
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2+
//~^ ERROR default values for const generic parameters are unstable
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2-
--> $DIR/default_trait_param.rs:1:28
1+
error: default values for const generic parameters are unstable
2+
--> $DIR/default_trait_param.rs:1:30
33
|
44
LL | trait Foo<const KIND: bool = true> {}
5-
| ^ expected one of 7 possible tokens
5+
| ^^^^
6+
|
7+
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
68

79
error: aborting due to previous error
810

0 commit comments

Comments
 (0)