Skip to content

Use 'self: Pin<&mut Self>' on AsyncRead/AsyncWrite #1465

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

Merged
merged 2 commits into from
Mar 19, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Mar 1, 2019

Closes #1454

concerns:

  • Most methods of AsyncReadExt/AsyncWriteExt require Self: Unpin.

  • Add a new dependency (pin-project). - Removed

@taiki-e taiki-e force-pushed the io-pin branch 2 times, most recently from c9ba313 to 7dec9f9 Compare March 2, 2019 11:46
@taiki-e taiki-e changed the title [WIP] Use 'self: Pin<&mut Self>' on AsyncRead and AsyncWrite Use 'self: Pin<&mut Self>' on AsyncRead/AsyncWrite Mar 12, 2019
@taiki-e
Copy link
Member Author

taiki-e commented Mar 13, 2019

"cycle detected" error is related to rust-lang/rust#55997.

@cramertj
Copy link
Member

This looks great, thanks so much! I'll go ahead and merge this for now, since it allows us to avoid some unnecessary allocation in the Stream -> AsyncRead shim and would allow the same in a hypothetical Sink/AsyncWrite shim, which could be extra-valuable when we get async streams / generators. If we discover people are hitting usability problems (which I don't anticipate) then we can revisit.

@cramertj cramertj merged commit 60ce74d into rust-lang:master Mar 19, 2019
@taiki-e taiki-e deleted the io-pin branch March 20, 2019 02:28
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

Successfully merging this pull request may close these issues.

2 participants