]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/issue-53114-safety-checks.stderr
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / 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    = note: `#[deny(unaligned_references)]` on by default
8    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
10    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
11    = 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)
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    = note: `#[deny(unaligned_references)]` on by default
113    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
114    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
115    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
116    = 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)
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    = note: `#[deny(unaligned_references)]` on by default
126    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
127    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
128    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
129    = 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)
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    = note: `#[deny(unaligned_references)]` on by default
139    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
140    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
141    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
142    = 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)
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    = note: `#[deny(unaligned_references)]` on by default
152    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
153    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
154    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
155    = 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)
156