Closed mladedav closed 4 months ago
Closes #2857
Functions which are Fn or FnMut fail to compile when they are instrumented with #[instrument(ret)]
Fn
FnMut
#[instrument(ret)]
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.
[&mut (), 0]
FnOnce
Seems similar to #2847 ?
You're right, I'll close it in favor of your PR.
Closes #2857
Motivation
Functions which are
Fn
orFnMut
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 thanFnOnce
.