async-book
async-book copied to clipboard
Include info about std’s `pin` macro when talking about stack pinning
In section 4, stack pinning is said to require unsafe
, and it talks about the pitfalls that can come from dropping a Pin
early. However, with the new pin
macro, there is a safe way to pin something to the stack, and the pitfalls the book mentions can be checked by the compiler, since the inner value gets moved into the pin (and so cannot be used after being passed to the macro).
It’s a relatively new feature, so even if we can’t replace the existing content, we should probably mention it.