From c2ce00d51ab2468e9098b8da825192ef89061086 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Tue, 19 Nov 2024 15:37:53 -0500 Subject: [PATCH] internal: pass `db_lt` to the `inner_fn` --- components/salsa-macros/src/tracked_fn.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/salsa-macros/src/tracked_fn.rs b/components/salsa-macros/src/tracked_fn.rs index 57023ef2..d1689af6 100644 --- a/components/salsa-macros/src/tracked_fn.rs +++ b/components/salsa-macros/src/tracked_fn.rs @@ -75,6 +75,10 @@ impl Macro { let mut inner_fn = item.clone(); inner_fn.vis = syn::Visibility::Inherited; inner_fn.sig.ident = self.hygiene.ident("inner"); + // if the tracked_fn has a lifetime, pass it to the `inner_fn` + // if item.sig.generics.lifetimes().peekable().next().is_some() { + inner_fn.sig.generics = parse_quote!(<#db_lt>); + // } let zalsa = self.hygiene.ident("zalsa"); let Configuration = self.hygiene.ident("Configuration");