From 49138846590fb9e8a4739b76d81072e555fc2f71 Mon Sep 17 00:00:00 2001 From: Nika Layzell Date: Mon, 5 Sep 2022 14:36:32 -0400 Subject: [PATCH] proc_macro/bridge: Add #[inline] to RunningSameThreadGuard methods This is a potential fix to the perf regression from #101414. r? @eddyb --- library/proc_macro/src/bridge/server.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/proc_macro/src/bridge/server.rs b/library/proc_macro/src/bridge/server.rs index 8202c40d63170..c6bb034102e7e 100644 --- a/library/proc_macro/src/bridge/server.rs +++ b/library/proc_macro/src/bridge/server.rs @@ -160,6 +160,7 @@ thread_local! { struct RunningSameThreadGuard(()); impl RunningSameThreadGuard { + #[inline] fn new() -> Self { let already_running = ALREADY_RUNNING_SAME_THREAD.replace(true); assert!( @@ -171,6 +172,7 @@ impl RunningSameThreadGuard { } impl Drop for RunningSameThreadGuard { + #[inline] fn drop(&mut self) { ALREADY_RUNNING_SAME_THREAD.set(false); }