1
Fork 0

implement ConstEvaluatable goals in new solver

we don't yet handle `generic_const_exprs`, someone else
can do that :3
This commit is contained in:
lcnr 2023-07-04 15:40:15 +02:00
parent cd68ead9ec
commit abcaf30f9b
8 changed files with 75 additions and 9 deletions

View file

@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
--> $DIR/default-param-wf-concrete.rs:1:28
--> $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

View file

@ -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`.

View file

@ -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() {}