do not link non existant functions in the base library
All checks were successful
Rust / build-gnu-apt (pull_request) Successful in 1m59s
Rust / build-size-gnu-unstable (pull_request) Successful in 43s

This commit is contained in:
Vinzenz Schroeter 2025-06-28 17:21:00 +02:00
parent 284c005e4e
commit c702d832f4
3 changed files with 5 additions and 155 deletions

View file

@ -62,6 +62,8 @@ macro_rules! derive_command_into_packet {
#[doc = "Tries to turn a [`" $command_type "`] into a [Packet]."]
///
/// Returns: NULL or a [Packet] containing the command.
///
/// [Packet]: [`servicepoint::Packet`]
fn try_into_packet(move instance) -> move_ok *mut ::servicepoint::Packet {
instance.try_into()
};

View file

@ -14,9 +14,7 @@ macro_rules! derive_clone {
($object_type:ident) => {
$crate::macros::wrap_method!($object_type;
#[doc = concat!("Clones a [`", stringify!($object_type), "`] instance.")]
fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type> {
instance.clone()
};
fn clone(ref instance) -> move ::core::ptr::NonNull<$object_type>;
);
};
}
@ -31,6 +29,8 @@ macro_rules! wrap_method {
::paste::paste!{
$crate::macros::wrap_method!(
$object_type;
#[doc = " Calls method [`" $object_type "::" $function "`]."]
///
$(#[$meta])+
fn $function($ref_or_mut $instance $(, $($param_name: $param_modifier $param_type),*)?)
$(-> $return_modifier $return_type)? {
@ -47,8 +47,6 @@ macro_rules! wrap_method {
) => {
paste::paste! {
$crate::macros::wrap_functions!([< $object_type:lower >];
#[doc = " Calls method [`servicepoint::" $object_type "::" $function "`]."]
///
$(#[$meta])*
fn $function(
$instance: $ref_or_mut ::core::ptr::NonNull<$object_type>