From 5f14bbd60ee0f4e95d2a82fffeb25561d84f2d82 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Tue, 7 Jan 2025 12:12:13 -0500 Subject: [PATCH] fix completions in `#[salsa::tracked]` functions --- components/salsa-macro-rules/src/setup_tracked_fn.rs | 4 ++-- components/salsa-macros/src/tracked_fn.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/salsa-macro-rules/src/setup_tracked_fn.rs b/components/salsa-macro-rules/src/setup_tracked_fn.rs index accffbf44..7f57c4063 100644 --- a/components/salsa-macro-rules/src/setup_tracked_fn.rs +++ b/components/salsa-macro-rules/src/setup_tracked_fn.rs @@ -32,7 +32,7 @@ macro_rules! setup_tracked_fn { output_ty: $output_ty:ty, // Function body, may reference identifiers defined in `$input_pats` and the generics from `$generics` - inner_fn: $inner_fn:item, + inner_fn: {$($inner_fn:tt)*}, // Path to the cycle recovery function to use. cycle_recovery_fn: ($($cycle_recovery_fn:tt)*), @@ -172,7 +172,7 @@ macro_rules! setup_tracked_fn { } fn execute<$db_lt>($db: &$db_lt Self::DbView, ($($input_id),*): ($($input_ty),*)) -> Self::Output<$db_lt> { - $inner_fn + $($inner_fn)* $inner($db, $($input_id),*) } diff --git a/components/salsa-macros/src/tracked_fn.rs b/components/salsa-macros/src/tracked_fn.rs index 57023ef24..a59072ef4 100644 --- a/components/salsa-macros/src/tracked_fn.rs +++ b/components/salsa-macros/src/tracked_fn.rs @@ -125,7 +125,7 @@ impl Macro { input_ids: [#(#input_ids),*], input_tys: [#(#input_tys),*], output_ty: #output_ty, - inner_fn: #inner_fn, + inner_fn: { #inner_fn }, cycle_recovery_fn: #cycle_recovery_fn, cycle_recovery_strategy: #cycle_recovery_strategy, is_specifiable: #is_specifiable,