diff --git a/components/salsa-macro-rules/src/setup_tracked_struct.rs b/components/salsa-macro-rules/src/setup_tracked_struct.rs index 622230bea..252fbbcab 100644 --- a/components/salsa-macro-rules/src/setup_tracked_struct.rs +++ b/components/salsa-macro-rules/src/setup_tracked_struct.rs @@ -87,7 +87,6 @@ macro_rules! setup_tracked_struct { $Configuration:ident, $CACHE:ident, $Db:ident, - $NonNull:ident, $Revision:ident, ] ) => { @@ -104,7 +103,6 @@ macro_rules! setup_tracked_struct { use salsa::plumbing as $zalsa; use $zalsa::tracked_struct as $zalsa_struct; use $zalsa::Revision as $Revision; - use std::ptr::NonNull as $NonNull; type $Configuration = $Struct<'static>; @@ -207,8 +205,8 @@ macro_rules! setup_tracked_struct { #[inline] fn cast(id: $zalsa::Id, type_id: $zalsa::TypeId) -> $zalsa::Option { - if type_id == $zalsa::TypeId::of::<$Struct>() { - $zalsa::Some(<$Struct as $zalsa::FromId>::from_id(id)) + if type_id == $zalsa::TypeId::of::<$Struct<'static>>() { + $zalsa::Some(<$Struct<'static> as $zalsa::FromId>::from_id(id)) } else { $zalsa::None } @@ -289,6 +287,7 @@ macro_rules! setup_tracked_struct { )* } + #[allow(unused_lifetimes)] impl<'_db> $Struct<'_db> { /// Default debug formatting for this struct (may be useful if you define your own `Debug` impl) pub fn default_debug_fmt(this: Self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result diff --git a/components/salsa-macros/src/tracked_struct.rs b/components/salsa-macros/src/tracked_struct.rs index f2a4ab9ab..ba4b33ad3 100644 --- a/components/salsa-macros/src/tracked_struct.rs +++ b/components/salsa-macros/src/tracked_struct.rs @@ -119,7 +119,6 @@ impl Macro { let Configuration = self.hygiene.ident("Configuration"); let CACHE = self.hygiene.ident("CACHE"); let Db = self.hygiene.ident("Db"); - let NonNull = self.hygiene.ident("NonNull"); let Revision = self.hygiene.ident("Revision"); Ok(crate::debug::dump_tokens( @@ -160,7 +159,6 @@ impl Macro { #Configuration, #CACHE, #Db, - #NonNull, #Revision, ] );