summaryrefslogtreecommitdiffstats
path: root/tests/ui/packed/packed-struct-borrow-element.stderr
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/packed-struct-borrow-element.stderr
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/packed-struct-borrow-element.stderr')
-rw-r--r--tests/ui/packed/packed-struct-borrow-element.stderr6
1 files changed, 4 insertions, 2 deletions
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