From dabae7eea4b2036477c39c89dfb77b21f03a0ac7 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 3 Oct 2025 21:27:26 +0000 Subject: [PATCH] Handle FreeFunctions outside with_api_handle_types It is a singleton which doesn't actually need to be passed through over the bridge. --- library/proc_macro/src/bridge/client.rs | 1 + library/proc_macro/src/bridge/mod.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/library/proc_macro/src/bridge/client.rs b/library/proc_macro/src/bridge/client.rs index 48a43a7bac34..e75902eca6bb 100644 --- a/library/proc_macro/src/bridge/client.rs +++ b/library/proc_macro/src/bridge/client.rs @@ -120,6 +120,7 @@ impl fmt::Debug for Span { } } +pub(crate) use super::FreeFunctions; pub(crate) use super::symbol::Symbol; macro_rules! define_client_side { diff --git a/library/proc_macro/src/bridge/mod.rs b/library/proc_macro/src/bridge/mod.rs index b0ee9c0cc302..15a81bd5f96f 100644 --- a/library/proc_macro/src/bridge/mod.rs +++ b/library/proc_macro/src/bridge/mod.rs @@ -49,7 +49,6 @@ macro_rules! with_api { ($S:ident, $self:ident, $m:ident) => { $m! { FreeFunctions { - fn drop($self: $S::FreeFunctions); fn injected_env_var(var: &str) -> Option; fn track_env_var(var: &str, value: Option<&str>); fn track_path(path: &str); @@ -109,7 +108,7 @@ macro_rules! with_api_handle_types { ($m:ident) => { $m! { 'owned: - FreeFunctions, + // FreeFunctions is handled manually TokenStream, 'interned: @@ -119,6 +118,8 @@ macro_rules! with_api_handle_types { }; } +pub(crate) struct FreeFunctions; + #[allow(unsafe_code)] mod arena; #[allow(unsafe_code)]