-
Notifications
You must be signed in to change notification settings - Fork 13.4k
min_const_generics
diagnostics improvements
#77825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
12 changes: 6 additions & 6 deletions
12
src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr
This file contains hidden or 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 hidden or 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
6 changes: 3 additions & 3 deletions
6
src/test/ui/const-generics/const-argument-if-length.min.stderr
This file contains hidden or 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 hidden or 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
6 changes: 3 additions & 3 deletions
6
...onst-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/feature-gate-const_evaluatable_checked.rs:6:33 | ||
| | ||
LL | type Arr<const N: usize> = [u8; N - 1]; | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| ^ cannot perform const operation using `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `N` | ||
|
||
error: aborting due to previous error | ||
|
This file contains hidden or 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
12 changes: 6 additions & 6 deletions
12
src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/simple.rs:8:53 | ||
| | ||
LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default { | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| ^ cannot perform const operation using `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `N` | ||
|
||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/simple.rs:8:35 | ||
| | ||
LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default { | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| ^ cannot perform const operation using `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `N` | ||
|
||
error: aborting due to 2 previous errors | ||
|
6 changes: 3 additions & 3 deletions
6
src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/simple_fail.rs:7:33 | ||
| | ||
LL | type Arr<const N: usize> = [u8; N - 1]; | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| ^ cannot perform const operation using `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `N` | ||
|
||
error: aborting due to previous error | ||
|
This file contains hidden or 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
12 changes: 6 additions & 6 deletions
12
src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/generic-function-call-in-array-length.rs:9:39 | ||
| | ||
LL | fn bar<const N: usize>() -> [u32; foo(N)] { | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| ^ cannot perform const operation using `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `N` | ||
|
||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/generic-function-call-in-array-length.rs:12:13 | ||
| | ||
LL | [0; foo(N)] | ||
| ^ non-trivial anonymous constants must not depend on the parameter `N` | ||
| ^ cannot perform const operation using `N` | ||
| | ||
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `N` | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains hidden or 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
12 changes: 6 additions & 6 deletions
12
src/test/ui/const-generics/generic-sum-in-array-length.min.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/generic-sum-in-array-length.rs:7:53 | ||
| | ||
LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {} | ||
| ^ non-trivial anonymous constants must not depend on the parameter `A` | ||
| ^ cannot perform const operation using `A` | ||
| | ||
= help: it is currently only allowed to use either `A` or `{ A }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `A` | ||
|
||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/generic-sum-in-array-length.rs:7:57 | ||
| | ||
LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {} | ||
| ^ non-trivial anonymous constants must not depend on the parameter `B` | ||
| ^ cannot perform const operation using `B` | ||
| | ||
= help: it is currently only allowed to use either `B` or `{ B }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `B` | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains hidden or 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
6 changes: 3 additions & 3 deletions
6
src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr
This file contains hidden or 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 hidden or 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
12 changes: 6 additions & 6 deletions
12
src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/issue-61522-array-len-succ.rs:7:45 | ||
| | ||
LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]); | ||
| ^^^^^ non-trivial anonymous constants must not depend on the parameter `COUNT` | ||
| ^^^^^ cannot perform const operation using `COUNT` | ||
| | ||
= help: it is currently only allowed to use either `COUNT` or `{ COUNT }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `COUNT` | ||
|
||
error: generic parameters must not be used inside of non-trivial constant values | ||
error: generic parameters must not be used inside const evaluations | ||
--> $DIR/issue-61522-array-len-succ.rs:12:30 | ||
| | ||
LL | fn inner(&self) -> &[u8; COUNT + 1] { | ||
| ^^^^^ non-trivial anonymous constants must not depend on the parameter `COUNT` | ||
| ^^^^^ cannot perform const operation using `COUNT` | ||
| | ||
= help: it is currently only allowed to use either `COUNT` or `{ COUNT }` as generic constants | ||
= help: const parameters may only be used as standalone arguments `COUNT` | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.