Debian Codegraph @

src/setup_tracked_method_body.rs

raw symbols SCIP
1 #[macro_export]
2 macro_rules! setup_tracked_method_body {
3 (
4 salsa_tracked_attr: #[$salsa_tracked_attr:meta],
5 self: $self:ident,
6 self_ty: $self_ty:ty,
7 db_lt: $($db_lt:lifetime)?,
8 db: $db:ident,
9 db_ty: ($($db_ty:tt)*),
10 input_ids: [$($input_id:ident),*],
11 input_tys: [$($input_ty:ty),*],
12 output_ty: $output_ty:ty,
13 inner_fn_name: $inner_fn_name:ident,
14 inner_fn: $inner_fn:item,
15 tracked_fn: $tracked_fn:item,
16
17 // Annoyingly macro-rules hygiene does not extend to items defined in the macro.
18 // We have the procedural macro generate names for those items that are
19 // not used elsewhere in the user's code.
20 unused_names: [
21 $InnerTrait:ident,
22 ]
23 ) => {
24 {
25 trait $InnerTrait<$($db_lt)?> {
26 fn $inner_fn_name($self, db: $($db_ty)*, $($input_id: $input_ty),*) -> $output_ty;
27 }
28
29 impl<$($db_lt)?> $InnerTrait<$($db_lt)?> for $self_ty {
30 $inner_fn
31 }
32
33 $tracked_fn
34
35 $inner_fn_name($db, $self, $($input_id),*)
36 }
37 };
38 }