Skip to content

Commit ee2a2ac

Browse files
committed
Add missed unsafe in the raw_set_bit function
Signed-off-by: Nik Konyuchenko <[email protected]>
1 parent 068d4ce commit ee2a2ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bindgen/codegen/bitfield_unit_raw_ref_macros.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ where
8080
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
8181

8282
let byte_index = index / 8;
83-
let byte = (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
84-
.offset(byte_index as isize);
83+
let byte = unsafe {
84+
(core::ptr::addr_of_mut!((*this).storage) as *mut u8)
85+
.offset(byte_index as isize)
86+
};
8587

8688
unsafe { *byte = Self::change_bit(*byte, index, val) };
8789
}

0 commit comments

Comments
 (0)