Skip to content

Commit

Permalink
Rollup merge of rust-lang#104782 - oli-obk:const_eval_limit_bump, r=p…
Browse files Browse the repository at this point in the history
…nkfelix

Bump the const eval step limit

fixes rust-lang#103814

rust-lang#103877 has too much of an impact to beta backport. So let's just increase the limit, avoiding the immediate breakage.

r? `@pnkfelix`
  • Loading branch information
matthiaskrgr authored Nov 24, 2022
2 parents d3b6e19 + 6c2719a commit e3f8e9c
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 e3f8e9c

Please sign in to comment.