-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
io: remove unsafe pin-projections and remove manual Unpin implementations #1588
Conversation
As references always implement Unpin, there is no need to implement Unpin manually. Also, changing Unpin requirements will be breaking changes, so add tests to check for Unpin requirements.
Thanks for this. Do we know how much this impacts compile time? |
I didn’t actually time it, but the master branch already depends on pin-project, so I think merging this should have little impact on compile time. Impact of adding pin-project to dependencies: As pin-project is a proc-macro, it increases the compilation time. If the dependencies have other proc-macro crates, the impact will not be so big. (As far as I know, whether or not the "full" feature of |
@carllerche I found the useful tool Build times (clean build): without pin-project (613fde2) Dependencies are compiled in parallel, so I don't think this has much impact if another proc-macro crate (tokio-macros, tracing-attribute, etc.) is already enabled. |
FWIW: I have written a lightweight version of pin-project written with declarative macros: https://github.com/taiki-e/pin-project-lite |
@taiki-e btw, how did you gen that graph? |
@carllerche I used |
Oh, nice, i missed all that 👍 |
Based on #1586 (First 2 commits are the same as #1586)
This removes most pin-projection related
unsafe
code: 16b06e3And removes manual
Unpin
implementations and add tests to check thatUnpin
requirement does not change accidentally. see commit message for more: 7ad962d