]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/unaligned_references.stderr
New upstream version 1.59.0+dfsg1
[rustc.git] / src / test / ui / lint / unaligned_references.stderr
CommitLineData
f9f354fc 1error: reference to packed field is unaligned
cdc7bbd5 2 --> $DIR/unaligned_references.rs:22:17
f9f354fc
XL
3 |
4LL | let _ = &good.ptr;
5 | ^^^^^^^^^
6 |
7note: the lint level is defined here
8 --> $DIR/unaligned_references.rs:1:9
9 |
10LL | #![deny(unaligned_references)]
11 | ^^^^^^^^^^^^^^^^^^^^
cdc7bbd5
XL
12 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
f9f354fc 14 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 15 = 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)
f9f354fc
XL
16
17error: reference to packed field is unaligned
cdc7bbd5 18 --> $DIR/unaligned_references.rs:24:17
f9f354fc
XL
19 |
20LL | let _ = &good.data;
21 | ^^^^^^^^^^
22 |
cdc7bbd5
XL
23 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
f9f354fc 25 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 26 = 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)
f9f354fc
XL
27
28error: reference to packed field is unaligned
cdc7bbd5 29 --> $DIR/unaligned_references.rs:27:17
f9f354fc
XL
30 |
31LL | let _ = &good.data as *const _;
32 | ^^^^^^^^^^
33 |
cdc7bbd5
XL
34 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
35 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
f9f354fc 36 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 37 = 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)
f9f354fc
XL
38
39error: reference to packed field is unaligned
cdc7bbd5 40 --> $DIR/unaligned_references.rs:29:27
f9f354fc
XL
41 |
42LL | let _: *const _ = &good.data;
43 | ^^^^^^^^^^
44 |
cdc7bbd5
XL
45 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
46 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
f9f354fc 47 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 48 = 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)
f9f354fc
XL
49
50error: reference to packed field is unaligned
cdc7bbd5 51 --> $DIR/unaligned_references.rs:32:17
f9f354fc
XL
52 |
53LL | let _ = good.data.clone();
c295e0f8 54 | ^^^^^^^^^^^^^^^^^
f9f354fc 55 |
cdc7bbd5
XL
56 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
57 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
f9f354fc 58 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 59 = 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)
f9f354fc
XL
60
61error: reference to packed field is unaligned
cdc7bbd5 62 --> $DIR/unaligned_references.rs:35:17
f9f354fc
XL
63 |
64LL | let _ = &good.data2[0];
65 | ^^^^^^^^^^^^^^
66 |
cdc7bbd5
XL
67 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
68 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
f9f354fc 69 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 70 = 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)
f9f354fc 71
cdc7bbd5
XL
72error: reference to packed field is unaligned
73 --> $DIR/unaligned_references.rs:45:17
74 |
75LL | let _ = &packed2.x;
76 | ^^^^^^^^^^
77 |
78 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
79 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
80 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
a2a8927a 81 = 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)
cdc7bbd5
XL
82
83error: aborting due to 7 previous errors
f9f354fc 84