New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: Add tracing spans to macro generated database #16772
Conversation
@@ -235,13 +235,24 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream | |||
|
|||
queries_with_storage.push(fn_name); | |||
|
|||
let tracing = if let QueryStorage::Memoized = query.storage { | |||
let s = format!("{trait_name}::{fn_name}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's been a second since I last looked at writing proc macros, but I think that quote::format_ident
is preferable to allocating here. if that doesn't work, i'd consider making the trait the target here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This intentional is a string, because we want to expand it to a string literal, not an ident, Also this allocation happens at expansion time so it doesn't really matter as it doesn't happen when running the query
@bors r+ |
☀️ Test successful - checks-actions |
No description provided.