-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathsafe_packed_borrows.stderr
24 lines (23 loc) · 1.42 KB
/
safe_packed_borrows.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
--> $DIR/safe_packed_borrows.rs:17:5
|
17 | &a.field; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
| ^^^^^^^^
|
note: the lint level is defined here
--> $DIR/safe_packed_borrows.rs:1:9
|
1 | #![deny(safe_packed_borrows)]
| ^^^^^^^^^^^^^^^^^^^
= 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 #46043 <https://github.com/rust-lang/rust/issues/46043>
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
--> $DIR/safe_packed_borrows.rs:20:5
|
20 | &b.field; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
| ^^^^^^^^
|
= 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 #46043 <https://github.com/rust-lang/rust/issues/46043>
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior