mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Rollup merge of #78960 - ethanboxx:const-gen-test-default-error, r=lcnr
Test default values for const parameters. The last topic on #78433 I originally intended to place these tests in a single file, however, due to them being parser errors that are fatal, they must be in separate files to be detected. Thanks, ``@lcnr`` for mentoring me on this PR. r? ``@lcnr``
This commit is contained in:
commit
a2e9e3b6af
@ -0,0 +1,6 @@
|
||||
#![feature(min_const_generics)]
|
||||
|
||||
fn foo<const SIZE: usize = 5>() {}
|
||||
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,8 @@
|
||||
error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
|
||||
--> $DIR/default_function_param.rs:3:26
|
||||
|
|
||||
LL | fn foo<const SIZE: usize = 5>() {}
|
||||
| ^ expected one of 7 possible tokens
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -0,0 +1,6 @@
|
||||
#![feature(min_const_generics)]
|
||||
|
||||
trait Foo<const KIND: bool = true> {}
|
||||
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,8 @@
|
||||
error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
|
||||
--> $DIR/default_trait_param.rs:3:28
|
||||
|
|
||||
LL | trait Foo<const KIND: bool = true> {}
|
||||
| ^ expected one of 7 possible tokens
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user