Skip to content

Commit 6a4529e

Browse files
committed
Fix test union-const-eval-field for big-endian
The test fails on s390x and presumably other big-endian systems, due to print of raw values with padding bytes. To fix the tests remove the raw output values in the error note with `normalize-stderr`.
1 parent fd9c825 commit 6a4529e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/ui/consts/const-eval/union-const-eval-field.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ dont-require-annotations: NOTE
22
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
3+
//@ normalize-stderr: "([[:xdigit:]]{2}\s){4}(__\s){4}\s+│\s+([?|\.]){4}\W{4}" -> "HEX_DUMP"
34

45
type Field1 = i32;
56
type Field2 = f32;

tests/ui/consts/const-eval/union-const-eval-field.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error[E0080]: reading memory at ALLOC0[0x0..0x8], but memory is uninitialized at [0x4..0x8], and this operation requires initialized memory
2-
--> $DIR/union-const-eval-field.rs:29:37
2+
--> $DIR/union-const-eval-field.rs:30:37
33
|
44
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
55
| ^^^^^^^^^^^^ evaluation of `read_field3::FIELD3` failed here
66
|
77
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
8-
00 00 80 3f __ __ __ __ │ ...?░░░░
8+
HEX_DUMP
99
}
1010

1111
note: erroneous constant encountered
12-
--> $DIR/union-const-eval-field.rs:31:5
12+
--> $DIR/union-const-eval-field.rs:32:5
1313
|
1414
LL | FIELD3
1515
| ^^^^^^
1616

1717
note: erroneous constant encountered
18-
--> $DIR/union-const-eval-field.rs:31:5
18+
--> $DIR/union-const-eval-field.rs:32:5
1919
|
2020
LL | FIELD3
2121
| ^^^^^^

0 commit comments

Comments
 (0)