Closed oxalica closed 5 years ago
@uHOOCCOOHu I have to admit I'm not as comfortable with pin semantics as I wish I was. If you suspect this can be removed & it makes life easier, we'd definitely welcome a patch to do so!
We definitely care a lot about allowing async fn
timeouts! (:
I'm quite sure that F: Unpin
is not required for time::Timeout
(and so do TimeoutAsyncRead
and TimeoutStream
), so the bound in time::FutureExt
can be also removed.
Sadly, if so, the poll()
method seems impossible to write without unsafe
(required for pinning projection). Since we have #![deny(unsafe_code)]
, I'm not sure if it is acceptable.
Until there are more Pin
helper functions, I don't think #![deny(unsafe_code)]
is achievable for any project implementing futures manually unless you box everything and require Unpin
on everything.
It seems not necessary since the
Future
is just a normal field ofTimeout
, according to the docs ofstd::pin
.Unpin
requirement makes it hard to set timeout forasync fn
.