mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-06 19:48:58 +00:00
clippy: use std::ptr::null
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
2f7b0872ea
commit
c09d8e1442
@ -37,7 +37,7 @@ pub use as_any::AsAny;
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! offsetof {
|
macro_rules! offsetof {
|
||||||
($ty:ty, $field:ident) => {
|
($ty:ty, $field:ident) => {
|
||||||
unsafe { &(*(0 as *const $ty)).$field as *const _ as usize }
|
unsafe { &(*(std::ptr::null::<$ty>())).$field as *const _ as usize }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user