]> git.lizzy.rs Git - rust.git/commitdiff
Bless and update consts tests
authorBryan Garza <1396101+bryangarza@users.noreply.github.com>
Wed, 4 Jan 2023 05:04:03 +0000 (05:04 +0000)
committerBryan Garza <1396101+bryangarza@users.noreply.github.com>
Mon, 23 Jan 2023 23:56:22 +0000 (23:56 +0000)
tests/ui/consts/const-eval/infinite_loop.stderr
tests/ui/consts/const-eval/issue-52475.rs
tests/ui/consts/const-eval/issue-52475.stderr
tests/ui/consts/const_limit/const_eval_limit_reached.stderr

index 8b58cb279f376a77ccb005913248ef46027a3144..f30bfaf3f958ce5349428b3185c6a175a28222ea 100644 (file)
@@ -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
 
index ce65407bbab0b5d928795c8b4fdc82297aac8625..307c1a66834105e316e559ebd2607a5cc75c6f54 100644 (file)
@@ -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
index 8536ff02c6dae89b96403ba90c8fd15b61f58a3b..3aa6bd277ddcbdd3f201f281b512d9604b688cc2 100644 (file)
@@ -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
 
index 850aebdfb2a6df7051bd24946f4e1492f0c4a54d..a8e8ae9bb088a07737324dd98aeaf9a3ad2762df 100644 (file)
@@ -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