Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example doesn't build #102

Open
MartijnBraam opened this issue Mar 2, 2019 · 0 comments
Open

Example doesn't build #102

MartijnBraam opened this issue Mar 2, 2019 · 0 comments

Comments

@MartijnBraam
Copy link

I've tried building the example in this repository and get this error:

   Compiling version_check v0.1.5
   Compiling libc v0.2.49
   Compiling autocfg v0.1.2
   Compiling semver-parser v0.7.0
   Compiling rand_core v0.4.0
   Compiling siphasher v0.2.3
   Compiling arrayvec v0.4.10
   Compiling byteorder v1.3.1
    Checking lazy_static v1.3.0
    Checking nodrop v0.1.13
    Checking stable_deref_trait v1.1.1
    Checking cfg-if v0.1.6
    Checking smallvec v0.6.9
    Checking scopeguard v0.3.3
    Checking matches v0.1.8
    Checking memoffset v0.2.1
    Checking slab v0.4.2
   Compiling httparse v1.3.3
    Checking traitobject v0.1.0
    Checking futures v0.1.25
    Checking lazycell v1.2.1
    Checking fnv v1.0.6
    Checking percent-encoding v1.0.1
    Checking itoa v0.4.3
    Checking safemem v0.3.0
    Checking string v0.1.3
    Checking language-tags v0.2.2
    Checking try-lock v0.2.2
    Checking indexmap v1.0.2
    Checking typeable v0.1.2
    Checking modifier v0.1.0
    Checking sequence_trie v0.3.6
    Checking rand_core v0.3.1
    Checking rand_jitter v0.1.3
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling unicase v1.4.2
   Compiling unicase v2.2.0
    Checking owning_ref v0.4.0
   Compiling semver v0.9.0
    Checking crossbeam-utils v0.6.5
    Checking log v0.4.6
    Checking unicode-bidi v0.3.4
    Checking unsafe-any v0.4.2
    Checking unicode-normalization v0.1.8
    Checking rand_isaac v0.1.1
    Checking rand_xorshift v0.1.1
    Checking rand_hc v0.1.0
    Checking lock_api v0.1.5
    Checking typemap v0.3.3
    Checking log v0.3.9
    Checking crossbeam-queue v0.1.2
   Compiling rustc_version v0.2.3
    Checking plugin v0.2.6
    Checking crossbeam-epoch v0.7.1
    Checking mime v0.2.6
    Checking rand_os v0.1.2
    Checking iovec v0.1.2
    Checking net2 v0.2.33
    Checking num_cpus v1.10.0
    Checking time v0.1.42
    Checking tokio-sync v0.1.3
    Checking tokio-executor v0.1.6
    Checking want v0.0.6
    Checking base64 v0.9.3
   Compiling parking_lot_core v0.4.0
    Checking phf_shared v0.7.24
    Checking bytes v0.4.11
    Checking futures-cpupool v0.1.8
    Checking crossbeam-deque v0.7.1
    Checking mio v0.6.16
    Checking tokio-timer v0.2.10
    Checking tokio-current-thread v0.1.5
    Checking mime v0.3.13
    Checking phf v0.7.24
    Checking tokio-io v0.1.12
    Checking http v0.1.16
    Checking tokio-threadpool v0.1.12
    Checking parking_lot v0.7.1
    Checking tokio-reactor v0.1.9
   Compiling phf_generator v0.7.24
   Compiling phf_codegen v0.7.24
    Checking tokio v0.1.16
    Checking tokio-tcp v0.1.3
   Compiling mime_guess v1.8.6
   Compiling mime_guess v2.0.0-alpha.6
    Checking h2 v0.1.16
    Checking idna v0.1.5
    Checking url v1.7.2
    Checking hyper v0.12.25
    Checking hyper v0.10.15
    Checking iron v0.6.0
    Checking iron v0.6.0 (https://github.com/iron/iron#1909e5b0)
    Checking mount v0.4.0
    Checking mount v0.4.0 (https://github.com/iron/mount.git#5dbbc881)
    Checking staticfile v0.5.0
    Checking router v0.1.0 (/home/martijn/Projects/Rust/router)
error[E0432]: unresolved import `iron::StatusCode`
 --> src/main.rs:4:49
  |
4 | use iron::{Iron, Request, Response, IronResult, StatusCode};
  |                                                 ^^^^^^^^^^ no `StatusCode` in the root

error[E0432]: unresolved import `iron::StatusCode`
 --> src/main.rs:4:49
  |
4 | use iron::{Iron, Request, Response, IronResult, StatusCode};
  |                                                 ^^^^^^^^^^ no `StatusCode` in the root

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:11
   |
12 | fn intercept(req: &mut Request) -> IronResult<Response> {
   | ------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |           ^^^^^ expected signature of `for<'r> fn(&'r mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {intercept}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:11
   |
12 | fn intercept(req: &mut Request) -> IronResult<Response> {
   | ------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |           ^^^^^ expected signature of `fn(&mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {intercept}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:41
   |
7  | fn send_hello(req: &mut Request) -> IronResult<Response> {
   | -------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |                                         ^^^^^ expected signature of `for<'r> fn(&'r mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {send_hello}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:41
   |
7  | fn send_hello(req: &mut Request) -> IronResult<Response> {
   | -------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |                                         ^^^^^ expected signature of `fn(&mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {send_hello}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:11
   |
12 | fn intercept(req: &mut Request) -> IronResult<Response> {
   | ------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |           ^^^^^ expected signature of `for<'r> fn(&'r mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {intercept}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:11
   |
12 | fn intercept(req: &mut Request) -> IronResult<Response> {
   | ------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |           ^^^^^ expected signature of `fn(&mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {intercept}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:41
   |
7  | fn send_hello(req: &mut Request) -> IronResult<Response> {
   | -------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |                                         ^^^^^ expected signature of `for<'r> fn(&'r mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {send_hello}`

error[E0631]: type mismatch in function arguments
  --> src/main.rs:19:41
   |
7  | fn send_hello(req: &mut Request) -> IronResult<Response> {
   | -------------------------------------------------------- found signature of `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> _`
...
19 |     mount.mount("/blocked/", intercept).mount("/", send_hello);
   |                                         ^^^^^ expected signature of `fn(&mut iron::request::Request) -> _`
   |
   = note: required because of the requirements on the impl of `iron::middleware::Handler` for `for<'r, 's, 't0> fn(&'r mut iron::Request<'s, 't0>) -> std::result::Result<iron::Response, iron::IronError> {send_hello}`

error[E0277]: expected a `std::ops::Fn<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
  --> src/main.rs:21:5
   |
21 |     Iron::new(mount).http("localhost:3000");
   |     ^^^^^^^^^ expected an `Fn<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
   |
   = help: the trait `for<'r, 's, 't0> std::ops::Fn<(&'r mut iron::Request<'s, 't0>,)>` is not implemented for `mount::Mount`
   = note: required because of the requirements on the impl of `iron::Handler` for `mount::Mount`
   = note: required by `<iron::Iron<H>>::new`

error[E0277]: expected a `std::ops::FnOnce<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
  --> src/main.rs:21:5
   |
21 |     Iron::new(mount).http("localhost:3000");
   |     ^^^^^^^^^ expected an `FnOnce<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
   |
   = help: the trait `std::ops::FnOnce<(&mut iron::Request<'_, '_>,)>` is not implemented for `mount::Mount`
   = note: required because of the requirements on the impl of `iron::Handler` for `mount::Mount`
   = note: required by `<iron::Iron<H>>::new`

error[E0277]: expected a `std::ops::Fn<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
  --> src/main.rs:21:5
   |
21 |     Iron::new(mount).http("localhost:3000");
   |     ^^^^^^^^^ expected an `Fn<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
   |
   = help: the trait `for<'r, 's, 't0> std::ops::Fn<(&'r mut iron::Request<'s, 't0>,)>` is not implemented for `mount::Mount`
   = note: required because of the requirements on the impl of `iron::Handler` for `mount::Mount`
   = note: required by `<iron::Iron<H>>::new`

error[E0277]: expected a `std::ops::FnOnce<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
  --> src/main.rs:21:5
   |
21 |     Iron::new(mount).http("localhost:3000");
   |     ^^^^^^^^^ expected an `FnOnce<(&mut iron::Request<'_, '_>,)>` closure, found `mount::Mount`
   |
   = help: the trait `std::ops::FnOnce<(&mut iron::Request<'_, '_>,)>` is not implemented for `mount::Mount`
   = note: required because of the requirements on the impl of `iron::Handler` for `mount::Mount`
   = note: required by `<iron::Iron<H>>::new`

error[E0599]: no method named `http` found for type `iron::Iron<mount::Mount>` in the current scope
  --> src/main.rs:21:22
   |
21 |     Iron::new(mount).http("localhost:3000");
   |                      ^^^^
   |
   = note: the method `http` exists but the following trait bounds were not satisfied:
           `mount::Mount : iron::Handler`

error[E0599]: no method named `http` found for type `iron::Iron<mount::Mount>` in the current scope
  --> src/main.rs:21:22
   |
21 |     Iron::new(mount).http("localhost:3000");
   |                      ^^^^
   |
   = note: the method `http` exists but the following trait bounds were not satisfied:
           `mount::Mount : iron::Handler`

error: aborting due to 8 previous errors

Some errors occurred: E0277, E0432, E0599, E0631.
For more information about an error, try `rustc --explain E0277`.
error: aborting due to 8 previous errors

Some errors occurred: E0277, E0432, E0599, E0631.
For more information about an error, try `rustc --explain E0277`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant