You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.3.8 happens to be the version of futures in the playground at the time of writing, so that playground link compiles at the moment. That might change when playground next grabs crates.
But with 0.3.10 and 0.3.11, it fails:
error[E0277]: `T` cannot be unpinned
--> src/main.rs:43:23
|
43 | ready!(self.0.poll_unpin(cx));
| ^^^^^^^^^^ within `futures_util::future::MaybeDone<futures_util::future::AndThen<MessageResponse, futures_util::future::Ready<std::result::Result<T, Error>>, fn(MessageBufEtc) -> futures_util::future::Ready<std::result::Result<T, Error>>>>`, the trait `std::marker::Unpin` is not implemented for `T`
|
= note: required because it appears within the type `std::result::Result<T, Error>`
= note: required because it appears within the type `futures_util::future::MaybeDone<futures_util::future::AndThen<MessageResponse, futures_util::future::Ready<std::result::Result<T, Error>>, fn(MessageBufEtc) -> futures_util::future::Ready<std::result::Result<T, Error>>>>`
help: consider restricting type parameter `T`
|
39 | impl<T: std::marker::Unpin> Future for QueryResponseFut<T> {
| ^^^^^^^^^^^^^^^^^^^^
error[E0277]: `T` cannot be unpinned
--> src/main.rs:44:35
|
44 | let maybe_done = Pin::new(&mut self.0);
| ^^^^^^^^^^^ within `futures_util::future::MaybeDone<futures_util::future::AndThen<MessageResponse, futures_util::future::Ready<std::result::Result<T, Error>>, fn(MessageBufEtc) -> futures_util::future::Ready<std::result::Result<T, Error>>>>`, the trait `std::marker::Unpin` is not implemented for `T`
|
= note: required because it appears within the type `std::result::Result<T, Error>`
= note: required because it appears within the type `futures_util::future::MaybeDone<futures_util::future::AndThen<MessageResponse, futures_util::future::Ready<std::result::Result<T, Error>>, fn(MessageBufEtc) -> futures_util::future::Ready<std::result::Result<T, Error>>>>`
= note: required by `std::pin::Pin::<P>::new`
help: consider restricting type parameter `T`
|
39 | impl<T: std::marker::Unpin> Future for QueryResponseFut<T> {
| ^^^^^^^^^^^^^^^^^^^^
I believe I actually first saw this failure in 0.3.9 but that version is yanked now so I haven't tested this exact snippet.
The following code compiles with futures_util 0.3.8:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7af38519429f4b3e8a8a96cd6f645910
0.3.8 happens to be the version of futures in the playground at the time of writing, so that playground link compiles at the moment. That might change when playground next grabs crates.
But with 0.3.10 and 0.3.11, it fails:
I believe I actually first saw this failure in 0.3.9 but that version is yanked now so I haven't tested this exact snippet.
The above code snippet is extracted from the real code in https://cs.opensource.google/fuchsia/fuchsia/+/master:src/lib/fidl/rust/fidl/src/client.rs;l=56;drc=06b9342965f7c226e7a29aa735e19ef2a2a951e6 if that's interesting, but context shouldn't actually be necessary to observe that this is a breaking change.
The text was updated successfully, but these errors were encountered: