|
| 1 | +warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133) |
| 2 | + --> $DIR/issue-53114-safety-checks.rs:23:13 |
| 3 | + | |
| 4 | +LL | let _ = &p.b; |
| 5 | + | ^^^^ |
| 6 | + | |
| 7 | + = note: `#[warn(safe_packed_borrows)]` 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 #46043 <https://github.com/rust-lang/rust/issues/46043> |
| 10 | + = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior |
| 11 | + |
| 12 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 13 | + --> $DIR/issue-53114-safety-checks.rs:26:13 |
| 14 | + | |
| 15 | +LL | let _ = &u2.a; |
| 16 | + | ^^^^^ access to union field |
| 17 | + | |
| 18 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 19 | + |
| 20 | +warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133) |
| 21 | + --> $DIR/issue-53114-safety-checks.rs:29:17 |
| 22 | + | |
| 23 | +LL | let (_,) = (&p.b,); |
| 24 | + | ^^^^ |
| 25 | + | |
| 26 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 27 | + = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043> |
| 28 | + = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior |
| 29 | + |
| 30 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 31 | + --> $DIR/issue-53114-safety-checks.rs:31:17 |
| 32 | + | |
| 33 | +LL | let (_,) = (u1.a,); |
| 34 | + | ^^^^ access to union field |
| 35 | + | |
| 36 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 37 | + |
| 38 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 39 | + --> $DIR/issue-53114-safety-checks.rs:32:17 |
| 40 | + | |
| 41 | +LL | let (_,) = (&u2.a,); |
| 42 | + | ^^^^^ access to union field |
| 43 | + | |
| 44 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 45 | + |
| 46 | +warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133) |
| 47 | + --> $DIR/issue-53114-safety-checks.rs:39:11 |
| 48 | + | |
| 49 | +LL | match &p.b { _ => { } } |
| 50 | + | ^^^^ |
| 51 | + | |
| 52 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 53 | + = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043> |
| 54 | + = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior |
| 55 | + |
| 56 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 57 | + --> $DIR/issue-53114-safety-checks.rs:41:11 |
| 58 | + | |
| 59 | +LL | match u1.a { _ => { } } |
| 60 | + | ^^^^ access to union field |
| 61 | + | |
| 62 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 63 | + |
| 64 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 65 | + --> $DIR/issue-53114-safety-checks.rs:42:11 |
| 66 | + | |
| 67 | +LL | match &u2.a { _ => { } } |
| 68 | + | ^^^^^ access to union field |
| 69 | + | |
| 70 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 71 | + |
| 72 | +warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133) |
| 73 | + --> $DIR/issue-53114-safety-checks.rs:45:12 |
| 74 | + | |
| 75 | +LL | match (&p.b,) { (_,) => { } } |
| 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 #46043 <https://github.com/rust-lang/rust/issues/46043> |
| 80 | + = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior |
| 81 | + |
| 82 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 83 | + --> $DIR/issue-53114-safety-checks.rs:47:12 |
| 84 | + | |
| 85 | +LL | match (u1.a,) { (_,) => { } } |
| 86 | + | ^^^^ access to union field |
| 87 | + | |
| 88 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 89 | + |
| 90 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 91 | + --> $DIR/issue-53114-safety-checks.rs:48:12 |
| 92 | + | |
| 93 | +LL | match (&u2.a,) { (_,) => { } } |
| 94 | + | ^^^^^ access to union field |
| 95 | + | |
| 96 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 97 | + |
| 98 | +error: aborting due to 7 previous errors |
| 99 | + |
| 100 | +For more information about this error, try `rustc --explain E0133`. |
0 commit comments