Use addr_of_mut instead
This commit is contained in:
parent
03e650c02f
commit
e5000e470a
|
@ -148,7 +148,11 @@ macro_rules! pyobject_native_type_info(
|
|||
// Create a very short lived mutable reference and directly
|
||||
// cast it to a pointer: no mutable references can be aliasing
|
||||
// because we hold the GIL.
|
||||
#[cfg(not(addr_of))]
|
||||
unsafe { &mut $typeobject }
|
||||
|
||||
#[cfg(addr_of)]
|
||||
unsafe { ::std::ptr::addr_of_mut!($typeobject) }
|
||||
}
|
||||
|
||||
$(
|
||||
|
|
Loading…
Reference in a new issue