about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBryan Garza <1396101+bryangarza@users.noreply.github.com>2023-01-04 05:04:03 +0000
committerBryan Garza <1396101+bryangarza@users.noreply.github.com>2023-01-23 23:56:22 +0000
commit75b7c6c8ecc6865823e64ff6b2ab5b018c8ca15b (patch)
treec55a3aea3327b297855e7eb688b4afff94a01541
parentaae331d610f318cd2d472c39f1e09b02d4f83d81 (diff)
downloadrust-75b7c6c8ecc6865823e64ff6b2ab5b018c8ca15b.tar.gz
rust-75b7c6c8ecc6865823e64ff6b2ab5b018c8ca15b.zip
Bless and update consts tests
-rw-r--r--tests/ui/consts/const-eval/infinite_loop.stderr9
-rw-r--r--tests/ui/consts/const-eval/issue-52475.rs4
-rw-r--r--tests/ui/consts/const-eval/issue-52475.stderr9
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_reached.stderr9
4 files changed, 20 insertions, 11 deletions
diff --git a/tests/ui/consts/const-eval/infinite_loop.stderr b/tests/ui/consts/const-eval/infinite_loop.stderr
index 8b58cb279f3..f30bfaf3f95 100644
--- a/tests/ui/consts/const-eval/infinite_loop.stderr
+++ b/tests/ui/consts/const-eval/infinite_loop.stderr
@@ -1,8 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/infinite_loop.rs:6:15
+  --> $DIR/infinite_loop.rs:6:9
    |
-LL |         while n != 0 {
-   |               ^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+LL | /         while n != 0 {
+LL | |
+LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+LL | |         }
+   | |_________^ exceeded interpreter step limit (see `#[const_eval_limit]`)
 
 error: aborting due to previous error
 
diff --git a/tests/ui/consts/const-eval/issue-52475.rs b/tests/ui/consts/const-eval/issue-52475.rs
index ce65407bbab..307c1a66834 100644
--- a/tests/ui/consts/const-eval/issue-52475.rs
+++ b/tests/ui/consts/const-eval/issue-52475.rs
@@ -2,8 +2,8 @@ fn main() {
     let _ = [(); {
         let mut x = &0;
         let mut n = 0;
-        while n < 5 {
-            n = (n + 1) % 5; //~ ERROR evaluation of constant value failed
+        while n < 5 { //~ ERROR evaluation of constant value failed [E0080]
+            n = (n + 1) % 5;
             x = &0; // Materialize a new AllocId
         }
         0
diff --git a/tests/ui/consts/const-eval/issue-52475.stderr b/tests/ui/consts/const-eval/issue-52475.stderr
index 8536ff02c6d..3aa6bd277dd 100644
--- a/tests/ui/consts/const-eval/issue-52475.stderr
+++ b/tests/ui/consts/const-eval/issue-52475.stderr
@@ -1,8 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-52475.rs:6:17
+  --> $DIR/issue-52475.rs:5:9
    |
-LL |             n = (n + 1) % 5;
-   |                 ^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+LL | /         while n < 5 {
+LL | |             n = (n + 1) % 5;
+LL | |             x = &0; // Materialize a new AllocId
+LL | |         }
+   | |_________^ exceeded interpreter step limit (see `#[const_eval_limit]`)
 
 error: aborting due to previous error
 
diff --git a/tests/ui/consts/const_limit/const_eval_limit_reached.stderr b/tests/ui/consts/const_limit/const_eval_limit_reached.stderr
index 850aebdfb2a..a8e8ae9bb08 100644
--- a/tests/ui/consts/const_limit/const_eval_limit_reached.stderr
+++ b/tests/ui/consts/const_limit/const_eval_limit_reached.stderr
@@ -1,8 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const_eval_limit_reached.rs:6:11
+  --> $DIR/const_eval_limit_reached.rs:6:5
    |
-LL |     while x != 1000 {
-   |           ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+LL | /     while x != 1000 {
+LL | |
+LL | |         x += 1;
+LL | |     }
+   | |_____^ exceeded interpreter step limit (see `#[const_eval_limit]`)
 
 error: aborting due to previous error