You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the code I want to defer has any ?s, the defer block doesn't work, which is to be expected.
Since drop() doesn't return a Result, this would probably have to be implemented with an attribute macro that moves the block to the end of the function, instead of relying on functions going out of scope.
Thoughts?
The text was updated successfully, but these errors were encountered:
This problem arises more generally when you try to return (from the function) inside a defer block.
I see several disadvantages of simply moving the defer block to the end though:
You need an attribute macro, which makes it less ergonomic imo and harder to generate a defer block from a macro (this is a minor use case admittedly).
If you can early return from a defer block, the other defer blocks aren't executed.
If the code I want to defer has any
?
s, the defer block doesn't work, which is to be expected.Since drop() doesn't return a Result, this would probably have to be implemented with an attribute macro that moves the block to the end of the function, instead of relying on functions going out of scope.
Thoughts?
The text was updated successfully, but these errors were encountered: