Skip to content

Commit

Permalink
Merge pull request #612 from Veykril/veykril/push-lkqxvrqmzkoy
Browse files Browse the repository at this point in the history
Emit struct in `#[tracked]` fn last for better IDE support
  • Loading branch information
davidbarsky authored Nov 7, 2024
2 parents dfbe6d6 + b0fafce commit e4d36da
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/salsa-macro-rules/src/setup_tracked_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ macro_rules! setup_tracked_fn {
$inner:ident,
]
) => {
#[allow(non_camel_case_types)]
$vis struct $fn_name {
_priv: std::convert::Infallible,
}

// Suppress this clippy lint because we sometimes require `'db` where the ordinary Rust rules would not.
#[allow(clippy::needless_lifetimes)]
$(#[$attr])*
Expand Down Expand Up @@ -288,5 +283,12 @@ macro_rules! setup_tracked_fn {
}
})
}
// The struct needs be last in the macro expansion in order to make the tracked
// function's ident be identified as a function, not a struct, during semantic highlighting.
// for more details, see https://github.com/salsa-rs/salsa/pull/612.
#[allow(non_camel_case_types)]
$vis struct $fn_name {
_priv: std::convert::Infallible,
}
};
}

0 comments on commit e4d36da

Please sign in to comment.