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

Include info about std’s pin macro when talking about stack pinning #195

Open
mathmaster13 opened this issue Mar 15, 2023 · 0 comments
Open

Comments

@mathmaster13
Copy link

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.

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

No branches or pull requests

1 participant