($type:ty where $base:tt: VMState $($where:tt)*) => {
unsafe impl<$base> $crate::vmstate::VMState for $type where $base: $crate::vmstate::VMState $($where)* {
const BASE: $crate::vmstate::VMStateField = $crate::vmstate::VMStateField {
- size: mem::size_of::<$type>(),
+ size: ::core::mem::size_of::<$type>(),
..<$base as $crate::vmstate::VMState>::BASE
};
const VARRAY_FLAG: $crate::bindings::VMStateFlags = <$base as $crate::vmstate::VMState>::VARRAY_FLAG;
impl_vmstate_transparent!(std::cell::UnsafeCell<T> where T: VMState);
impl_vmstate_transparent!(std::pin::Pin<T> where T: VMState);
impl_vmstate_transparent!(common::Opaque<T> where T: VMState);
+impl_vmstate_transparent!(std::mem::ManuallyDrop<T> where T: VMState);
#[macro_export]
macro_rules! impl_vmstate_bitsized {
};
use common::Opaque;
-use migration::impl_vmstate_pointer;
+use migration::{impl_vmstate_pointer, impl_vmstate_transparent};
use crate::bindings::{
self, object_class_dynamic_cast, object_dynamic_cast, object_get_class, object_get_typename,
#[derive(Debug)]
#[repr(transparent)]
pub struct ParentField<T: ObjectType>(std::mem::ManuallyDrop<T>);
+impl_vmstate_transparent!(ParentField<T> where T: VMState + ObjectType);
impl<T: ObjectType> Deref for ParentField<T> {
type Target = T;