Skip to content

Commit d544f59

Browse files
committed
Force inline db proc-macro generated functions
1 parent bf1b73e commit d544f59

File tree

1 file changed

+4
-0
lines changed
  • components/salsa-macros/src

1 file changed

+4
-0
lines changed

components/salsa-macros/src/db.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ impl DbMacro {
8989
use salsa::plumbing as #zalsa;
9090

9191
unsafe impl #zalsa::HasStorage for #db {
92+
#[inline(always)]
9293
fn storage(&self) -> &#zalsa::Storage<Self> {
9394
&self.#storage
9495
}
9596

97+
#[inline(always)]
9698
fn storage_mut(&mut self) -> &mut #zalsa::Storage<Self> {
9799
&mut self.#storage
98100
}
@@ -131,12 +133,14 @@ impl DbMacro {
131133

132134
input.items.push(parse_quote! {
133135
#[doc(hidden)]
136+
#[inline(always)]
134137
fn register_downcaster(&self) {
135138
salsa::plumbing::views(self).add(<Self as #TraitPath>::downcast);
136139
}
137140
});
138141
input.items.push(parse_quote! {
139142
#[doc(hidden)]
143+
#[inline(always)]
140144
unsafe fn downcast(db: &dyn salsa::plumbing::Database) -> &dyn #TraitPath where Self: Sized {
141145
debug_assert_eq!(db.type_id(), ::core::any::TypeId::of::<Self>());
142146
// SAFETY: Same as the safety of the `downcast` method.

0 commit comments

Comments
 (0)