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
I've created #2897 to be merged into master and then backported to v0.1.x since that's the workflow here.
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
.