forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#78960 - ethanboxx:const-gen-test-default-er…
…ror, r=lcnr Test default values for const parameters. The last topic on rust-lang#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`
- Loading branch information
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
src/test/ui/const-generics/min_const_generics/default_function_param.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![feature(min_const_generics)] | ||
|
||
fn foo<const SIZE: usize = 5>() {} | ||
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/min_const_generics/default_function_param.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
6 changes: 6 additions & 0 deletions
6
src/test/ui/const-generics/min_const_generics/default_trait_param.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![feature(min_const_generics)] | ||
|
||
trait Foo<const KIND: bool = true> {} | ||
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/min_const_generics/default_trait_param.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|