Skip to content
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

Merged
merged 3 commits into from Mar 7, 2024

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Mar 6, 2024

No description provided.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 6, 2024
@@ -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}");
Copy link
Contributor

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.

Copy link
Member Author

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

@Veykril Veykril changed the title Add tracing spans to macro generated database internal: Add tracing spans to macro generated database Mar 7, 2024
@Veykril
Copy link
Member Author

Veykril commented Mar 7, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 7, 2024

📌 Commit 9c2fa76 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 7, 2024

⌛ Testing commit 9c2fa76 with merge 00f6a7a...

@bors
Copy link
Collaborator

bors commented Mar 7, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 00f6a7a to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants