Skip to content
Merged
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/ptr_fragments_in_final.rs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate that you have to disable the test entirely on s390x instead of just fragment_in_padding but I see that that would necessitate a separate compiletest revision just for s390x to be able to make the annotation //~ERROR: partial pointer in final value conditional which seems like overkill. Well.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Test that we properly error when there is a pointer fragment in the final value.
//@ ignore-s390x different alignment on s390x make the test fail

use std::{mem::{self, MaybeUninit}, ptr};

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/consts/const-eval/ptr_fragments_in_final.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error: encountered partial pointer in final value of constant
--> $DIR/ptr_fragments_in_final.rs:15:1
--> $DIR/ptr_fragments_in_final.rs:16:1
|
LL | const MEMCPY_RET: MaybeUninit<*const i32> = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: while pointers can be broken apart into individual bytes during const-evaluation, only complete pointers (with all their bytes in the right order) are supported in the final value

error: encountered partial pointer in final value of constant
--> $DIR/ptr_fragments_in_final.rs:24:1
--> $DIR/ptr_fragments_in_final.rs:25:1
|
LL | const MIXED_PTR: MaybeUninit<*const u8> = {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: while pointers can be broken apart into individual bytes during const-evaluation, only complete pointers (with all their bytes in the right order) are supported in the final value

error: encountered partial pointer in final value of constant
--> $DIR/ptr_fragments_in_final.rs:61:5
--> $DIR/ptr_fragments_in_final.rs:62:5
|
LL | const A: Thing = unsafe {
| ^^^^^^^^^^^^^^
Expand Down
Loading