dwango / fibers-rs

A Rust library to execute a number of lightweight asynchronous tasks (a.k.a, fibers) based on futures and mio.
MIT License
182 stars 11 forks source link

Does not compile on stable #6

Closed orlp closed 6 years ago

orlp commented 6 years ago

I have the latest Rust stable compiler, a total fresh test project, and fibers does not compile.

λ ~/programming/rust/testing/ master cargo --version
cargo 0.25.0 (96d8071da 2018-02-26)
λ ~/programming/rust/testing/ master rustc --version
rustc 1.24.1 (d3ae9a9e0 2018-02-27)
λ ~/programming/rust/testing/ master cat Cargo.toml 
[package]
name = "testing"
version = "0.1.0"
authors = ["Orson Peters <orsonpeters@gmail.com>"]

[dependencies]
fibers = "0.1"
λ ~/programming/rust/testing/ master cargo clean
λ ~/programming/rust/testing/ master cargo build
   Compiling lazycell v0.6.0
   Compiling byteorder v1.2.1
   Compiling slab v0.4.0
   Compiling cfg-if v0.1.2
   Compiling libc v0.2.39
   Compiling nbchan v0.1.2
   Compiling splay_tree v0.2.9
   Compiling futures v0.1.19
   Compiling log v0.4.1
   Compiling num_cpus v1.8.0
   Compiling iovec v0.1.2
   Compiling net2 v0.2.32
   Compiling mio v0.6.14
   Compiling handy_async v0.2.13
   Compiling fibers v0.1.9
error[E0599]: no method named `poll` found for type `&mut std::option::Option<sync::oneshot::Monitor<(), std::io::Error>>` in the current scope
   --> /home/orlp/.cargo/registry/src/github.com-1ecc6299db9ec823/fibers-0.1.9/src/net/tcp.rs:327:52
    |
327 |             if let Err(e) = self.monitor(interest).poll() {
    |                                                    ^^^^
    |
    = note: the method `poll` exists but the following trait bounds were not satisfied:
            `&mut std::option::Option<sync::oneshot::Monitor<(), std::io::Error>> : futures::Future`
            `&mut std::option::Option<sync::oneshot::Monitor<(), std::io::Error>> : futures::Stream`

error: aborting due to previous error

error: Could not compile `fibers`.

To learn more, run the command again with --verbose.
sile commented 6 years ago

It seems to be related to https://github.com/rust-lang-nursery/futures-rs/issues/892 .

The solution is under consideration, but as a workaround it is possible to build your project by adding following line to Cargo.toml :

[dependencies]
futures = "= 0.1.18"
sile commented 6 years ago

By updating futures to v0.1.20, this problem will be solved.