]> git.lizzy.rs Git - rust.git/blob - tests/ui/binding/issue-53114-safety-checks.stderr
57a065d6d4d2f1a6fc22b3a806764132e88a56c3
[rust.git] / tests / ui / binding / issue-53114-safety-checks.stderr
1 error: reference to packed field is unaligned
2   --> $DIR/issue-53114-safety-checks.rs:23:13
3    |
4 LL |     let _ = &p.b;
5    |             ^^^^
6    |
7    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
9    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
10    = 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)
11    = note: `#[deny(unaligned_references)]` on by default
12
13 error: reference to packed field is unaligned
14   --> $DIR/issue-53114-safety-checks.rs:29:17
15    |
16 LL |     let (_,) = (&p.b,);
17    |                 ^^^^
18    |
19    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
20    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
21    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
22    = 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)
23
24 error: reference to packed field is unaligned
25   --> $DIR/issue-53114-safety-checks.rs:39:11
26    |
27 LL |     match &p.b  { _ => { } }
28    |           ^^^^
29    |
30    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
31    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
32    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
33    = 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)
34
35 error: reference to packed field is unaligned
36   --> $DIR/issue-53114-safety-checks.rs:45:12
37    |
38 LL |     match (&p.b,)  { (_,) => { } }
39    |            ^^^^
40    |
41    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
42    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
43    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
44    = 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)
45
46 error[E0133]: access to union field is unsafe and requires unsafe function or block
47   --> $DIR/issue-53114-safety-checks.rs:26:13
48    |
49 LL |     let _ = &u2.a;
50    |             ^^^^^ access to union field
51    |
52    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
53
54 error[E0133]: access to union field is unsafe and requires unsafe function or block
55   --> $DIR/issue-53114-safety-checks.rs:31:17
56    |
57 LL |     let (_,) = (u1.a,);
58    |                 ^^^^ access to union field
59    |
60    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
61
62 error[E0133]: access to union field is unsafe and requires unsafe function or block
63   --> $DIR/issue-53114-safety-checks.rs:32:17
64    |
65 LL |     let (_,) = (&u2.a,);
66    |                 ^^^^^ access to union field
67    |
68    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
69
70 error[E0133]: access to union field is unsafe and requires unsafe function or block
71   --> $DIR/issue-53114-safety-checks.rs:41:11
72    |
73 LL |     match u1.a  { _ => { } }
74    |           ^^^^ access to union field
75    |
76    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
77
78 error[E0133]: access to union field is unsafe and requires unsafe function or block
79   --> $DIR/issue-53114-safety-checks.rs:42:11
80    |
81 LL |     match &u2.a { _ => { } }
82    |           ^^^^^ access to union field
83    |
84    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
85
86 error[E0133]: access to union field is unsafe and requires unsafe function or block
87   --> $DIR/issue-53114-safety-checks.rs:47:12
88    |
89 LL |     match (u1.a,)  { (_,) => { } }
90    |            ^^^^ access to union field
91    |
92    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
93
94 error[E0133]: access to union field is unsafe and requires unsafe function or block
95   --> $DIR/issue-53114-safety-checks.rs:48:12
96    |
97 LL |     match (&u2.a,) { (_,) => { } }
98    |            ^^^^^ access to union field
99    |
100    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
101
102 error: aborting due to 11 previous errors
103
104 For more information about this error, try `rustc --explain E0133`.
105 Future incompatibility report: Future breakage diagnostic:
106 error: reference to packed field is unaligned
107   --> $DIR/issue-53114-safety-checks.rs:23:13
108    |
109 LL |     let _ = &p.b;
110    |             ^^^^
111    |
112    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
113    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
114    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
115    = 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)
116    = note: `#[deny(unaligned_references)]` on by default
117
118 Future breakage diagnostic:
119 error: reference to packed field is unaligned
120   --> $DIR/issue-53114-safety-checks.rs:29:17
121    |
122 LL |     let (_,) = (&p.b,);
123    |                 ^^^^
124    |
125    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
126    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
127    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
128    = 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)
129    = note: `#[deny(unaligned_references)]` on by default
130
131 Future breakage diagnostic:
132 error: reference to packed field is unaligned
133   --> $DIR/issue-53114-safety-checks.rs:39:11
134    |
135 LL |     match &p.b  { _ => { } }
136    |           ^^^^
137    |
138    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
139    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
140    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
141    = 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)
142    = note: `#[deny(unaligned_references)]` on by default
143
144 Future breakage diagnostic:
145 error: reference to packed field is unaligned
146   --> $DIR/issue-53114-safety-checks.rs:45:12
147    |
148 LL |     match (&p.b,)  { (_,) => { } }
149    |            ^^^^
150    |
151    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
152    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
153    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
154    = 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)
155    = note: `#[deny(unaligned_references)]` on by default
156