We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ce0ab5 commit 94d4038Copy full SHA for 94d4038
rust/kernel/lib.rs
@@ -163,7 +163,8 @@ macro_rules! offset_of {
163
// To avoid warnings when nesting `unsafe` blocks.
164
#[allow(unused_unsafe)]
165
// SAFETY: The pointer is valid and aligned, just not initialised; `addr_of` ensures that
166
- // we don't actually dereference it (which would be UB).
+ // we don't actually read from `outer` (which would be UB) nor create an intermediate
167
+ // reference.
168
let inner = unsafe { core::ptr::addr_of!((*outer).$($f)*) } as *const u8;
169
170
0 commit comments