Skip to content
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

Bump the const eval step limit #104782

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Bump the const eval step limit
  • Loading branch information
oli-obk committed Nov 23, 2022
commit 6c2719a6d6d69dda07332f9f200d5fee19ae0096
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