diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs')
-rw-r--r-- | tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs index ca0eec93c..214f33dfb 100644 --- a/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs +++ b/tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs @@ -1,14 +1,22 @@ -// check-fail +// check-pass +// revisions: warn allow +#![cfg_attr(warn, warn(long_running_const_eval))] +#![cfg_attr(allow, allow(long_running_const_eval))] + // compile-flags: -Z tiny-const-eval-limit const fn simple_loop(n: u32) -> u32 { let mut index = 0; - while index < n { //~ ERROR evaluation of constant value failed [E0080] + while index < n { + //~^ WARN is taking a long time + //[warn]~| WARN is taking a long time + //[warn]~| WARN is taking a long time index = index + 1; } 0 } const X: u32 = simple_loop(19); +const Y: u32 = simple_loop(35); fn main() { println!("{X}"); |