Skip to content

Trigger a compiler warning if #[tracing::instrument] is placed after the #[builder] instead of before#264

Merged
Veetaha merged 3 commits intomasterfrom
fix/add-warning-for-tracing-instrument-macro-ordering
Mar 15, 2025
Merged

Trigger a compiler warning if #[tracing::instrument] is placed after the #[builder] instead of before#264
Veetaha merged 3 commits intomasterfrom
fix/add-warning-for-tracing-instrument-macro-ordering

Conversation

@Veetaha
Copy link
Collaborator

@Veetaha Veetaha commented Mar 15, 2025

Closes #259.

A new warning suggests moving the #[tracing::instrument] before the #[builder] macro. Doing it as a warning because this check is heuristic and may technically have false positives for macros that use the name instrument too. I don't know of any such macros, and if there are ones, I expect people will reach out and we'll work on a better solution.

@Veetaha Veetaha merged commit 90de22a into master Mar 15, 2025
27 checks passed
@Veetaha Veetaha deleted the fix/add-warning-for-tracing-instrument-macro-ordering branch March 15, 2025 18:03
@github-actions github-actions bot mentioned this pull request Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trigger a compiler warning if bon::builder macro is used before the tracing::instrument

2 participants