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 #2892

Closed
wants to merge 1 commit into from

Conversation

mladedav
Copy link
Contributor

Closes #2857

Motivation

Functions which are Fn or FnMut fail to compile when they are instrumented with #[instrument(ret)]

Solution

I've added a non-copy zst ([&mut (), 0]) to the generated code that is moved inside the function so that it is forced to be no more than FnOnce.

@mladedav mladedav requested review from hawkw and a team as code owners February 26, 2024 09:19
@mladedav
Copy link
Contributor Author

mladedav commented Mar 1, 2024

I've created #2897 to be merged into master and then backported to v0.1.x since that's the workflow here.

@mladedav mladedav closed this Mar 1, 2024
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.

1 participant