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

attributes: force instrumented function to be FnOnce #2847

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Hakuyume
Copy link

@Hakuyume Hakuyume commented Jan 9, 2024

Motivation

close #2796

Solution

Bind a non-Copy value in the closure.

@Hakuyume Hakuyume marked this pull request as ready for review January 10, 2024 04:27
Copy link
Contributor

@mladedav mladedav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for bikeshedding, but I think it would be good to change the PR title so that it's clear what happens here. The name is usually also used as the commit title so it would save the maintainers some work of writing the commit themselves.

tracing-attributes/tests/instrument.rs Outdated Show resolved Hide resolved
@Hakuyume Hakuyume changed the title Fix 2796 attributes: force instrumented function to be FnOnce Mar 6, 2024
@Hakuyume
Copy link
Author

Hakuyume commented Mar 6, 2024

@mladedav Thank you for your suggestion. I changed the PR title (just copied from yours).

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.

#[tracing::instrument(err)] fails to build when Ok variant has lifetime, "lifetime may not live long enough"
3 participants