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

Add a #[must_use] annotation to Span #3234

Open
wants to merge 1 commit into
base: v0.1.x
Choose a base branch
from

Conversation

radix
Copy link

@radix radix commented Mar 13, 2025

Motivation

I noticed we had some code at work that was creating spans with e.g. info_span!() and not doing anything with the spans. This seems like it should be prevented.

Please let me know if I'm wrong about this and there are useful use-cases for creating and not using Spans and I'll close this PR.

Solution

Add a #[must_use] to tracing::Span.

@radix radix requested review from hawkw, davidbarsky and a team as code owners March 13, 2025 20:36
@radix radix requested review from yaahc and carllerche as code owners March 18, 2025 16:07
@radix radix changed the base branch from master to v0.1.x March 18, 2025 16:07
@radix
Copy link
Author

radix commented Mar 18, 2025

I've updated this PR to target 0.1.x, since that's the version we're on.

I'm not sure what the CI failures are about - they don't seem relevant to my change but maybe I'm missing a subtle implication of my change.

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.

None yet

1 participant