tokio-rs / tokio-minihttp

Protocol implementation experimentations
Apache License 2.0
448 stars 50 forks source link

compile-time error #4

Closed szagi3891 closed 8 years ago

szagi3891 commented 8 years ago
grzegorz@grzegorz:~/Pulpit/tokio-minihttp$ cargo run --example hello_world
    Updating git repository `https://github.com/tokio-rs/tokio-proto`
    Updating git repository `https://github.com/tokio-rs/tokio-service`
    Updating git repository `https://github.com/alexcrichton/futures-rs`
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/carllerche/bytes`
    Updating git repository `https://github.com/tokio-rs/tokio-core`
   Compiling winapi v0.2.8
   Compiling utf8-ranges v0.1.3
   Compiling winapi-build v0.1.1
   Compiling kernel32-sys v0.2.2
   Compiling semver v0.1.20
   Compiling rustc_version v0.1.7
   Compiling nix v0.6.0
   Compiling byteorder v0.5.3
   Compiling regex-syntax v0.3.5
   Compiling bitflags v0.4.0
   Compiling libc v0.2.16
   Compiling cfg-if v0.1.0
   Compiling take v0.1.0
   Compiling lazycell v0.4.0
   Compiling smallvec v0.2.0
   Compiling thread-id v2.0.0
   Compiling thread_local v0.2.6
   Compiling log v0.3.6
   Compiling futures v0.1.1 (https://github.com/alexcrichton/futures-rs#1b05e0e2)
   Compiling httparse v1.1.2
   Compiling slab v0.3.0
   Compiling time v0.1.35
   Compiling void v1.0.2
   Compiling memchr v0.1.11
   Compiling aho-corasick v0.5.3
   Compiling regex v0.1.77
   Compiling env_logger v0.3.5
   Compiling bytes v0.4.0-dev (https://github.com/carllerche/bytes#f693e038)
   Compiling rand v0.3.14
   Compiling futures v0.1.1
   Compiling tokio-service v0.1.0 (https://github.com/tokio-rs/tokio-service#4dfeaba1)
   Compiling net2 v0.2.26
   Compiling mio v0.6.0
   Compiling scoped-tls v0.1.0
   Compiling tokio-core v0.1.0
   Compiling tokio-proto v0.1.0 (https://github.com/tokio-rs/tokio-proto#63028a16)
   Compiling tokio-core v0.1.0 (https://github.com/tokio-rs/tokio-core#418a9735)
   Compiling tokio-minihttp v0.1.0 (file:///home/grzegorz/Pulpit/tokio-minihttp)
error[E0432]: unresolved import `tokio_proto::NewService`
  --> src/lib.rs:24:37
   |
24 | use tokio_proto::{pipeline, server, NewService};
   |                                     ^^^^^^^^^^ no `NewService` in `tokio_proto`

error: cannot continue compilation due to previous error

error: Could not compile `tokio-minihttp`.

To learn more, run the command again with --verbose.
grzegorz@grzegorz:~/Pulpit/tokio-minihttp$ 
grzegorz@grzegorz:~/Pulpit/tokio-minihttp$ git log -1
commit 1e8ec6a8cb11d7c0306651a240ba90ff78c4ab16
Author: Carl Lerche <me@carllerche.com>
Date:   Thu Sep 8 19:29:48 2016 -0700

    Track tokio-service changes
grzegorz@grzegorz:~/Pulpit/tokio-minihttp$ 
szagi3891 commented 8 years ago

@carllerche :

When I replace this line:

-use tokio_proto::{pipeline, server, NewService};
-use tokio_service::{Service};
+use tokio_proto::{pipeline, server};
+use tokio_service::{Service, NewService};

I get new errors :

grzegorz@grzegorz:~/Pulpit/rust/tokio-minihttp$ cargo run --example hello_world
   Compiling tokio-minihttp v0.1.0 (file:///home/grzegorz/Pulpit/rust/tokio-minihttp)
error[E0277]: the trait bound `futures::Map<<T as tokio_service::Service>::Future, fn(response::Response) -> tokio_proto::pipeline::Message<response::Response, futures::stream::Receiver<(), std::io::Error>>>: futures::Future` is not satisfied
  --> src/lib.rs:81:9
   |
81 | impl<T> Service for HttpService<T>
   |         ^^^^^^^ trait `futures::Map<<T as tokio_service::Service>::Future, fn(response::Response) -> tokio_proto::pipeline::Message<response::Response, futures::stream::Receiver<(), std::io::Error>>>: futures::Future` not satisfied
   |
   = note: required by `tokio_service::Service`

error[E0277]: the trait bound `<T as tokio_service::Service>::Future: futures::Future` is not satisfied
  --> src/lib.rs:87:5
   |
87 |     type Future = Map<T::Future, fn(Response) -> pipeline::Message<Response, Receiver<(), io::Error>>>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `<T as tokio_service::Service>::Future: futures::Future` not satisfied
   |
   = help: consider adding a `where <T as tokio_service::Service>::Future: futures::Future` bound
   = note: required by `futures::Map`

error[E0277]: the trait bound `<T as tokio_service::Service>::Future: futures::Future` is not satisfied
  --> src/lib.rs:89:5
   |
89 |     fn call(&self, req: Request) -> Self::Future {
   |     ^ trait `<T as tokio_service::Service>::Future: futures::Future` not satisfied
   |
   = help: consider adding a `where <T as tokio_service::Service>::Future: futures::Future` bound
   = note: required by `futures::Map`

error: aborting due to 3 previous errors

error: Could not compile `tokio-minihttp`.

To learn more, run the command again with --verbose.
grzegorz@grzegorz:~/Pulpit/rust/tokio-minihttp$ 

I do not know what to do with it :(

carllerche commented 8 years ago

Fixed by 4249fa1c20fdd6aa206e2e274a4e755988626902