Skip to content

Commit 94d4038

Browse files
committed
Update safety comment.
1 parent 6ce0ab5 commit 94d4038

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rust/kernel/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ macro_rules! offset_of {
163163
// To avoid warnings when nesting `unsafe` blocks.
164164
#[allow(unused_unsafe)]
165165
// 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).
166+
// we don't actually read from `outer` (which would be UB) nor create an intermediate
167+
// reference.
167168
let inner = unsafe { core::ptr::addr_of!((*outer).$($f)*) } as *const u8;
168169
// To avoid warnings when nesting `unsafe` blocks.
169170
#[allow(unused_unsafe)]

0 commit comments

Comments
 (0)