Compare commits

..

1 commit

Author SHA1 Message Date
Vinzenz Schroeter 91e8771e81 add derives
Some checks failed
Rust / build-gnu-apt (pull_request) Successful in 2m5s
Rust / build-size-gnu-unstable (pull_request) Failing after 2m47s
2025-06-26 23:22:18 +02:00

View file

@ -1,23 +1,27 @@
macro_rules! derive_free { macro_rules! derive_free {
($object_type:ident) => { ($typ:ident) => {
$crate::macros::wrap_method!($object_type; ::paste::paste! {
#[doc = concat!("Deallocates a [`", stringify!($object_type), "`] instance.")] $crate::macros::wrap_method!($typ;
#[allow(dropping_copy_types)] #[doc = "Deallocates a [`" $typ "`] instance."]
fn free(move instance) { #[allow(dropping_copy_types)]
::std::mem::drop(instance) fn free(move instance) {
}; ::std::mem::drop(instance)
); };
);
}
}; };
} }
macro_rules! derive_clone { macro_rules! derive_clone {
($object_type:ident) => { ($object_type:ident) => {
$crate::macros::wrap_method!($object_type; ::paste::paste! {
#[doc = concat!("Clones a [`", stringify!($object_type), "`] instance.")] $crate::macros::wrap_method!($object_type;
fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> { #[doc = "Clones a [`" $object_type "`] instance."]
instance.clone() fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> {
}; instance.clone()
); };
);
}
}; };
} }
@ -265,7 +269,7 @@ macro_rules! wrap {
$( $(
derives: derives:
$( $(
$derive:path $( [ $( $derive_arg:tt ),+ ] )? $derive:path $( [ $( $derive_arg:ident ),+ ] )?
),+; ),+;
)? )?
$( $(