Skip to content

Commit 6c2719a

Browse files
committed
Bump the const eval step limit
1 parent 4e0d0d7 commit 6c2719a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler/rustc_middle/src/middle/limits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn provide(providers: &mut ty::query::Providers) {
3838
tcx.hir().krate_attrs(),
3939
tcx.sess,
4040
sym::const_eval_limit,
41-
1_000_000,
41+
2_000_000,
4242
),
4343
}
4444
}

src/test/ui/consts/const-eval/infinite_loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ fn main() {
44
let _ = [(); {
55
let mut n = 113383; // #20 in https://oeis.org/A006884
66
while n != 0 {
7-
n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
87
//~^ ERROR evaluation of constant value failed
8+
n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
99
}
1010
n
1111
}];

src/test/ui/consts/const-eval/infinite_loop.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/infinite_loop.rs:7:20
2+
--> $DIR/infinite_loop.rs:6:15
33
|
4-
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
5-
| ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
4+
LL | while n != 0 {
5+
| ^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)