summaryrefslogtreecommitdiffstats
path: root/tests/ui/packed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/ui/packed
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/packed')
-rw-r--r--tests/ui/packed/issue-27060.stderr12
-rw-r--r--tests/ui/packed/packed-struct-borrow-element-64bit.stderr3
-rw-r--r--tests/ui/packed/packed-struct-borrow-element.stderr6
3 files changed, 14 insertions, 7 deletions
diff --git a/tests/ui/packed/issue-27060.stderr b/tests/ui/packed/issue-27060.stderr
index b4753284f..4dc31a283 100644
--- a/tests/ui/packed/issue-27060.stderr
+++ b/tests/ui/packed/issue-27060.stderr
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
@@ -13,7 +14,8 @@ error[E0793]: reference to packed field is unaligned
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
@@ -22,7 +24,8 @@ error[E0793]: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
@@ -31,7 +34,8 @@ error[E0793]: reference to packed field is unaligned
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error: aborting due to 4 previous errors
diff --git a/tests/ui/packed/packed-struct-borrow-element-64bit.stderr b/tests/ui/packed/packed-struct-borrow-element-64bit.stderr
index 32943b0f0..57630a4b4 100644
--- a/tests/ui/packed/packed-struct-borrow-element-64bit.stderr
+++ b/tests/ui/packed/packed-struct-borrow-element-64bit.stderr
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error: aborting due to previous error
diff --git a/tests/ui/packed/packed-struct-borrow-element.stderr b/tests/ui/packed/packed-struct-borrow-element.stderr
index 29d867fc5..c1f749d6f 100644
--- a/tests/ui/packed/packed-struct-borrow-element.stderr
+++ b/tests/ui/packed/packed-struct-borrow-element.stderr
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
@@ -13,7 +14,8 @@ error[E0793]: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error: aborting due to 2 previous errors