Tokio: Tokio-async-await fails to compile on latest nightly

Created on 9 Apr 2019  Â·  8Comments  Â·  Source: tokio-rs/tokio

Version


Latest stable from crates.io, e. g. tokio-async-await 0.1.6, Tokio 0.1.18.

Platform


Latest rust nightly, e. g. rustc 1.35.0-nightly (3750348da 2019-04-08) on a x86_64 Windows 10, using latest msys2.

Subcrates


Definitely tokio-async-await

Description


When compiling a project which has tokio-async-await as a dependenci, its compilation fails with the following output:
`` Compiling serde_derive v1.0.90 Compiling pest_generator v2.1.0 Compiling devise_core v0.2.0 Compiling pear_codegen v0.1.2 Compiling diesel_derives v1.4.0 Compiling synstructure v0.10.1 Checking tokio-async-await v0.1.6 error[E0053]: methodpollhas an incompatible type for trait --> C:\Users\lukas\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-async-await-0.1.6\src\compat\forward.rs:56:5 | 56 | fn poll(mut self: Pin<&mut Self>, _waker: &Waker) -> StdPoll<Self::Output> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected typefn(std::pin::Pin<&mut compat::forward::Compat>, &mut std::task::Context<'_>) -> std::task::Poll::Item, ::Error>> found typefn(std::pin::Pin<&mut compat::forward::Compat>, &std::task::Waker) -> std::task::Poll::Item, ::Error>>`

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\io\flush.rs:26:5
|
26 | fn poll(mut self: Pin<&mut Self>, _wx: &Waker) -> Poll {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut io::flush::Flush<'a, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<(), std::io::Error>>
found type fn(std::pin::Pin<&mut io::flush::Flush<'a, T>>, &std::task::Waker) -> std::task::Poll<std::result::Result<(), std::io::Error>>

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\io\read.rs:28:5
|
28 | fn poll(mut self: Pin<&mut Self>, _waker: &task::Waker) -> Poll {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut io::read::Read<'a, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<usize, std::io::Error>>
found type fn(std::pin::Pin<&mut io::read::Read<'a, T>>, &std::task::Waker) -> std::task::Poll<std::result::Result<usize, std::io::Error>>

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\io\read_exact.rs:33:5
|
33 | fn poll(mut self: Pin<&mut Self>, _waker: &task::Waker) -> Poll {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut io::read_exact::ReadExact<'a, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<(), std::io::Error>>
found type fn(std::pin::Pin<&mut io::read_exact::ReadExact<'a, T>>, &std::task::Waker) -> std::task::Poll<std::result::Result<(), std::io::Error>>

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\io\write.rs:28:5
|
28 | fn poll(mut self: Pin<&mut Self>, _waker: &task::Waker) -> Poll> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut io::write::Write<'a, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<usize, std::io::Error>>
found type fn(std::pin::Pin<&mut io::write::Write<'a, T>>, &std::task::Waker) -> std::task::Poll<std::result::Result<usize, std::io::Error>>

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\io\write_all.rs:33:5
|
33 | fn poll(mut self: Pin<&mut Self>, _waker: &task::Waker) -> Poll | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut io::write_all::WriteAll<'a, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<(), std::io::Error>>
found type fn(std::pin::Pin<&mut io::write_all::WriteAll<'a, T>>, &std::task::Waker) -> std::task::Poll<std::result::Result<(), std::io::Error>>

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\sink\send.rs:30:5
|
30 | fn poll(mut self: Pin<&mut Self>, _waker: &task::Waker) -> Poll {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut sink::send::Send<'_, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<(), <T as futures::Sink>::SinkError>>
found type fn(std::pin::Pin<&mut sink::send::Send<'_, T>>, &std::task::Waker) -> std::task::Poll<std::result::Result<(), <T as futures::Sink>::SinkError>>

error[E0053]: method poll has an incompatible type for trait
--> C:\Users\lukas.cargo\registry\src\github.com-1ecc6299db9ec823tokio-async-await-0.1.6\src\stream\next.rs:24:5
|
24 | fn poll(mut self: Pin<&mut Self>, _waker: &Waker) -> Poll {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type fn(std::pin::Pin<&mut stream::next::Next<'a, T>>, &mut std::task::Context<'_>) -> std::task::Poll<std::option::Option<std::result::Result<<T as futures::Stream>::Item, <T as futures::Stream>::Error>>>
found type fn(std::pin::Pin<&mut stream::next::Next<'a, T>>, &std::task::Waker) -> std::task::Poll<std::option::Option<std::result::Result<<T as futures::Stream>::Item, <T as futures::Stream>::Error>>>

error: aborting due to 8 previous errors

For more information about this error, try rustc --explain E0053.
error: Could not compile tokio-async-await.
warning: build failed, waiting for other jobs to finish...
error: build failed
```

Most helpful comment

@taiki-e - Is there any more changes to futures_api planned? O.o (unless I'm mistaken, that's pretty much it for now?)

Wondering if it makes sense to cut a release.. would be incredibly helpful to get the ball rolling on getting the ecosystem back up to speed with the latest nightly.

All 8 comments

https://github.com/tokio-rs/tokio/pull/1041 will solve this.

However, futures_api will make several changes within the next few weeks, so probably it will take a while to release the next version.

Also, it can be avoided by pinning the nightly toolchain to the 2019-04-07 or early.

Thank you for the information.

@taiki-e - Is there any more changes to futures_api planned? O.o (unless I'm mistaken, that's pretty much it for now?)

Wondering if it makes sense to cut a release.. would be incredibly helpful to get the ball rolling on getting the ecosystem back up to speed with the latest nightly.

If it helps anybody else, the most recent Rust which supports tokio, tokio-async-await, rls and clippy appears to be nightly-2019-03-23 as of April 22, 2019.

@emk or for those that do want latest nightly,

[dependencies]
futures-preview = "0.3.0-alpha.14"
tokio = { version = "0.1.18", features = ["async-await-preview"] }
[patch.crates-io]
tokio = { git = "https://github.com/tokio-rs/tokio" }
tokio-async-await = { git = "https://github.com/tokio-rs/tokio" }

currently works splendidly.

It works with nightly from 2019-04-07 for me.

The nightly version that works with the async-await feature is tracked in the azure-pipelines.yml file.

The upcoming (#1053) release will support the latest nightly.

A new crate has been published. Cheers!

Was this page helpful?
0 / 5 - 0 ratings