Skip to content

Fix test intrinsic-raw_eq-const-bad for big-endian #144631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/ui/consts/const-eval/union-const-eval-field.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ dont-require-annotations: NOTE
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([[:xdigit:]]{2}\s){4}(__\s){4}\s+│\s+([?|\.]){4}\W{4}" -> "HEX_DUMP"

type Field1 = i32;
type Field2 = f32;
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/consts/const-eval/union-const-eval-field.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error[E0080]: reading memory at ALLOC0[0x0..0x8], but memory is uninitialized at [0x4..0x8], and this operation requires initialized memory
--> $DIR/union-const-eval-field.rs:29:37
--> $DIR/union-const-eval-field.rs:30:37
|
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
| ^^^^^^^^^^^^ evaluation of `read_field3::FIELD3` failed here
|
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
00 00 80 3f __ __ __ __ │ ...?░░░░
HEX_DUMP
}

note: erroneous constant encountered
--> $DIR/union-const-eval-field.rs:31:5
--> $DIR/union-const-eval-field.rs:32:5
|
LL | FIELD3
| ^^^^^^

note: erroneous constant encountered
--> $DIR/union-const-eval-field.rs:31:5
--> $DIR/union-const-eval-field.rs:32:5
|
LL | FIELD3
| ^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ normalize-stderr: "[[:xdigit:]]{2} __ ([[:xdigit:]]{2}\s){2}" -> "HEX_DUMP"
#![feature(core_intrinsics)]

const RAW_EQ_PADDING: bool = unsafe {
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
error[E0080]: reading memory at ALLOC0[0x0..0x4], but memory is uninitialized at [0x1..0x2], and this operation requires initialized memory
--> $DIR/intrinsic-raw_eq-const-bad.rs:4:5
--> $DIR/intrinsic-raw_eq-const-bad.rs:5:5
|
LL | std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_PADDING` failed here
|
= note: the raw bytes of the constant (size: 4, align: 2) {
01 __ 02 00 │ .░..
HEX_DUMP │ .░..
}

error[E0080]: unable to turn pointer into integer
--> $DIR/intrinsic-raw_eq-const-bad.rs:9:5
--> $DIR/intrinsic-raw_eq-const-bad.rs:10:5
|
LL | std::intrinsics::raw_eq(&(&0), &(&1))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_PTR` failed here
Expand All @@ -18,7 +18,7 @@ LL | std::intrinsics::raw_eq(&(&0), &(&1))
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

error[E0080]: accessing memory with alignment 1, but alignment 4 is required
--> $DIR/intrinsic-raw_eq-const-bad.rs:16:5
--> $DIR/intrinsic-raw_eq-const-bad.rs:17:5
|
LL | std::intrinsics::raw_eq(aref, aref)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_NOT_ALIGNED` failed here
Expand Down
Loading