-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #75322 - JulianKnodt:revisions, r=lcnr
Add a bunch of const-generic revisions for `min_const_generics` This adds a bunch of revisions to `const-generic` tests which is part of #75279, but doesn't cover everything. r? @lcnr
- Loading branch information
Showing
155 changed files
with
1,325 additions
and
853 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/test/ui/const-generics/array-size-in-generic-struct-param.full.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,18 @@ | ||
error: constant expression depends on a generic parameter | ||
--> $DIR/array-size-in-generic-struct-param.rs:9:38 | ||
| | ||
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]); | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: constant expression depends on a generic parameter | ||
--> $DIR/array-size-in-generic-struct-param.rs:20:10 | ||
| | ||
LL | arr: [u8; CFG.arr_size], | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: aborting due to 2 previous errors | ||
|
27 changes: 27 additions & 0 deletions
27
src/test/ui/const-generics/array-size-in-generic-struct-param.min.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,27 @@ | ||
error: generic parameters must not be used inside of non trivial constant values | ||
--> $DIR/array-size-in-generic-struct-param.rs:9:48 | ||
| | ||
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]); | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
|
||
error: generic parameters must not be used inside of non trivial constant values | ||
--> $DIR/array-size-in-generic-struct-param.rs:20:15 | ||
| | ||
LL | arr: [u8; CFG.arr_size], | ||
| ^^^ non-trivial anonymous constants must not depend on the parameter `CFG` | ||
| | ||
= help: it is currently only allowed to use either `CFG` or `{ CFG }` as generic constants | ||
|
||
error: using `Config` as const generic parameters is forbidden | ||
--> $DIR/array-size-in-generic-struct-param.rs:18:21 | ||
| | ||
LL | struct B<const CFG: Config> { | ||
| ^^^^^^ | ||
| | ||
= note: the only supported types are integers, `bool` and `char` | ||
= note: more complex types are supported with `#[feature(const_generics)]` | ||
|
||
error: aborting due to 3 previous errors | ||
|
16 changes: 12 additions & 4 deletions
16
src/test/ui/const-generics/array-size-in-generic-struct-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
27 changes: 0 additions & 27 deletions
27
src/test/ui/const-generics/array-size-in-generic-struct-param.stderr
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
src/test/ui/const-generics/cannot-infer-const-args.full.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,11 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/cannot-infer-const-args.rs:12:5 | ||
| | ||
LL | foo(); | ||
| ^^^ | ||
| | ||
= note: unable to infer the value of a const parameter | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
11 changes: 11 additions & 0 deletions
11
src/test/ui/const-generics/cannot-infer-const-args.min.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,11 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/cannot-infer-const-args.rs:12:5 | ||
| | ||
LL | foo(); | ||
| ^^^ | ||
| | ||
= note: unable to infer the value of a const parameter | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
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
This file was deleted.
Oops, something went wrong.
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
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
11 changes: 0 additions & 11 deletions
11
src/test/ui/const-generics/concrete-const-as-fn-arg.stderr
This file was deleted.
Oops, something went wrong.
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
11 changes: 0 additions & 11 deletions
11
src/test/ui/const-generics/concrete-const-impl-method.stderr
This file was deleted.
Oops, something went wrong.
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
11 changes: 0 additions & 11 deletions
11
src/test/ui/const-generics/condition-in-trait-const-arg.stderr
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
src/test/ui/const-generics/const-argument-non-static-lifetime.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
11 changes: 0 additions & 11 deletions
11
src/test/ui/const-generics/const-argument-non-static-lifetime.stderr
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/const-expression-parameter.full.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/const-expression-parameter.rs:16:22 | ||
| | ||
LL | i32_identity::<1 + 2>(); | ||
| ^ expected one of `,` or `>` | ||
|
||
error: aborting due to previous error | ||
|
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/const-expression-parameter.min.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/const-expression-parameter.rs:16:22 | ||
| | ||
LL | i32_identity::<1 + 2>(); | ||
| ^ expected one of `,` or `>` | ||
|
||
error: aborting due to previous error | ||
|
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
Oops, something went wrong.