-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement
ConstEvaluatable
goals in new solver
we don't yet handle `generic_const_exprs`, someone else can do that :3
- Loading branch information
Showing
8 changed files
with
75 additions
and
9 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 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
2 changes: 1 addition & 1 deletion
2
...defaults/default-param-wf-concrete.stderr → ...lts/default-param-wf-concrete.next.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
9 changes: 9 additions & 0 deletions
9
tests/ui/const-generics/defaults/default-param-wf-concrete.old.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,9 @@ | ||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/default-param-wf-concrete.rs:4:28 | ||
| | ||
LL | struct Foo<const N: u8 = { 255 + 1 }>; | ||
| ^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
3 changes: 3 additions & 0 deletions
3
tests/ui/const-generics/defaults/default-param-wf-concrete.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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// revisions: old next | ||
//[next] compile-flags: -Ztrait-solver=next | ||
|
||
struct Foo<const N: u8 = { 255 + 1 }>; | ||
//~^ ERROR evaluation of constant value failed | ||
fn main() {} |
4 changes: 2 additions & 2 deletions
4
...const-len-underflow-separate-spans.stderr → ...-len-underflow-separate-spans.next.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
15 changes: 15 additions & 0 deletions
15
tests/ui/consts/const-len-underflow-separate-spans.old.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,15 @@ | ||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/const-len-underflow-separate-spans.rs:10:20 | ||
| | ||
LL | const LEN: usize = ONE - TWO; | ||
| ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow | ||
|
||
note: erroneous constant used | ||
--> $DIR/const-len-underflow-separate-spans.rs:14:17 | ||
| | ||
LL | let a: [i8; LEN] = unimplemented!(); | ||
| ^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
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