summaryrefslogtreecommitdiffstats
path: root/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/test/ui/packed/packed-struct-borrow-element-64bit.stderr35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr b/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
new file mode 100644
index 000000000..dcd1c19fa
--- /dev/null
+++ b/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
@@ -0,0 +1,35 @@
+warning: reference to packed field is unaligned
+ --> $DIR/packed-struct-borrow-element-64bit.rs:15:15
+ |
+LL | let brw = &foo.baz;
+ | ^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/packed-struct-borrow-element-64bit.rs:12:8
+ |
+LL | #[warn(unaligned_references)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = note: fields of packed structs are not properly aligned, and 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)
+
+warning: 1 warning emitted
+
+Future incompatibility report: Future breakage diagnostic:
+warning: reference to packed field is unaligned
+ --> $DIR/packed-struct-borrow-element-64bit.rs:15:15
+ |
+LL | let brw = &foo.baz;
+ | ^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/packed-struct-borrow-element-64bit.rs:12:8
+ |
+LL | #[warn(unaligned_references)]
+ | ^^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = note: fields of packed structs are not properly aligned, and 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)
+