Skip to content

Commit

Permalink
Bump the const eval step limit
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Nov 23, 2022
1 parent 4e0d0d7 commit 6c2719a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/middle/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/infinite_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}];
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/consts/const-eval/infinite_loop.stderr
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 6c2719a

Please sign in to comment.