Bump the const eval step limit

This commit is contained in:
Oli Scherer 2022-11-23 16:26:34 +00:00
parent 4e0d0d757e
commit 6c2719a6d6
3 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ pub fn provide(providers: &mut ty::query::Providers) {
tcx.hir().krate_attrs(),
tcx.sess,
sym::const_eval_limit,
1_000_000,
2_000_000,
),
}
}

View File

@ -4,8 +4,8 @@ fn main() {
let _ = [(); {
let mut n = 113383; // #20 in https://oeis.org/A006884
while n != 0 {
n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
//~^ ERROR evaluation of constant value failed
n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
}
n
}];

View File

@ -1,8 +1,8 @@
error[E0080]: evaluation of constant value failed
--> $DIR/infinite_loop.rs:7:20
--> $DIR/infinite_loop.rs:6:15
|
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
| ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
LL | while n != 0 {
| ^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
error: aborting due to previous error