Skip to content

Commit 75b7c6c

Browse files
committed
Bless and update consts tests
1 parent aae331d commit 75b7c6c

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

tests/ui/consts/const-eval/infinite_loop.stderr

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

710
error: aborting due to previous error
811

tests/ui/consts/const-eval/issue-52475.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ fn main() {
22
let _ = [(); {
33
let mut x = &0;
44
let mut n = 0;
5-
while n < 5 {
6-
n = (n + 1) % 5; //~ ERROR evaluation of constant value failed
5+
while n < 5 { //~ ERROR evaluation of constant value failed [E0080]
6+
n = (n + 1) % 5;
77
x = &0; // Materialize a new AllocId
88
}
99
0

tests/ui/consts/const-eval/issue-52475.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/issue-52475.rs:6:17
2+
--> $DIR/issue-52475.rs:5:9
33
|
4-
LL | n = (n + 1) % 5;
5-
| ^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
4+
LL | / while n < 5 {
5+
LL | | n = (n + 1) % 5;
6+
LL | | x = &0; // Materialize a new AllocId
7+
LL | | }
8+
| |_________^ exceeded interpreter step limit (see `#[const_eval_limit]`)
69

710
error: aborting due to previous error
811

tests/ui/consts/const_limit/const_eval_limit_reached.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/const_eval_limit_reached.rs:6:11
2+
--> $DIR/const_eval_limit_reached.rs:6:5
33
|
4-
LL | while x != 1000 {
5-
| ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
4+
LL | / while x != 1000 {
5+
LL | |
6+
LL | | x += 1;
7+
LL | | }
8+
| |_____^ exceeded interpreter step limit (see `#[const_eval_limit]`)
69

710
error: aborting due to previous error
811

0 commit comments

Comments
 (0)