Skip to content

Commit 4913884

Browse files
committed
proc_macro/bridge: Add #[inline] to RunningSameThreadGuard methods
This is a potential fix to the perf regression from #101414. r? @eddyb
1 parent 2dc703f commit 4913884

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/proc_macro/src/bridge/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ thread_local! {
160160
struct RunningSameThreadGuard(());
161161

162162
impl RunningSameThreadGuard {
163+
#[inline]
163164
fn new() -> Self {
164165
let already_running = ALREADY_RUNNING_SAME_THREAD.replace(true);
165166
assert!(
@@ -171,6 +172,7 @@ impl RunningSameThreadGuard {
171172
}
172173

173174
impl Drop for RunningSameThreadGuard {
175+
#[inline]
174176
fn drop(&mut self) {
175177
ALREADY_RUNNING_SAME_THREAD.set(false);
176178
}

0 commit comments

Comments
 (0)