Debian Codegraph @

third_party/rust/pin-project/tests/ui/pin_project/safe_packed_borrows.rs

raw
1 #![deny(renamed_and_removed_lints)]
2 #![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references`
3
4 // This lint was removed in https://github.com/rust-lang/rust/pull/82525 (nightly-2021-03-28).
5 // Refs:
6 // - https://github.com/rust-lang/rust/pull/82525
7 // - https://github.com/rust-lang/rust/issues/46043
8
9 #[repr(packed)]
10 struct Packed {
11 f: u32,
12 }
13
14 #[repr(packed(2))]
15 struct PackedN {
16 f: u32,
17 }
18
19 fn main() {
20 let a = Packed { f: 1 };
21 let _ = &a.f;
22
23 let b = PackedN { f: 1 };
24 let _ = &b.f;
25 }