From 6c2719a6d6d69dda07332f9f200d5fee19ae0096 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 23 Nov 2022 16:26:34 +0000 Subject: [PATCH] Bump the const eval step limit --- compiler/rustc_middle/src/middle/limits.rs | 2 +- src/test/ui/consts/const-eval/infinite_loop.rs | 2 +- src/test/ui/consts/const-eval/infinite_loop.stderr | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_middle/src/middle/limits.rs b/compiler/rustc_middle/src/middle/limits.rs index 53c4d926784..12aef66bcf9 100644 --- a/compiler/rustc_middle/src/middle/limits.rs +++ b/compiler/rustc_middle/src/middle/limits.rs @@ -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, ), } } diff --git a/src/test/ui/consts/const-eval/infinite_loop.rs b/src/test/ui/consts/const-eval/infinite_loop.rs index 14a573ccf5a..4babc9a2850 100644 --- a/src/test/ui/consts/const-eval/infinite_loop.rs +++ b/src/test/ui/consts/const-eval/infinite_loop.rs @@ -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 }]; diff --git a/src/test/ui/consts/const-eval/infinite_loop.stderr b/src/test/ui/consts/const-eval/infinite_loop.stderr index 3b5a0f22f28..8b58cb279f3 100644 --- a/src/test/ui/consts/const-eval/infinite_loop.stderr +++ b/src/test/ui/consts/const-eval/infinite_loop.stderr @@ -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