mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-22 17:42:10 -06:00
rust: enable clippy::ptr_cast_constness
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3a1c694d74
commit
5df3fe062f
7 changed files with 7 additions and 9 deletions
|
@ -388,7 +388,7 @@ where
|
|||
{
|
||||
#[allow(clippy::as_ptr_cast_mut)]
|
||||
{
|
||||
self.as_ptr::<U>() as *mut _
|
||||
self.as_ptr::<U>().cast_mut()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ impl<T: ObjectType> Owned<T> {
|
|||
// SAFETY NOTE: while NonNull requires a mutable pointer, only
|
||||
// Deref is implemented so the pointer passed to from_raw
|
||||
// remains const
|
||||
Owned(NonNull::new(ptr as *mut T).unwrap())
|
||||
Owned(NonNull::new(ptr.cast_mut()).unwrap())
|
||||
}
|
||||
|
||||
/// Obtain a raw C pointer from a reference. `src` is consumed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue