sunng87 / handlebars-iron

Handlebars middleware for Iron web framework
MIT License
119 stars 20 forks source link

Iron 0.4 #48

Closed sunng87 closed 7 years ago

gnunicorn commented 7 years ago

While the tests work, the examples do not:

handlebars-iron @(master ✔) $ cargo run --example server
warning: unused manifest key: package.metadata.release.sign-commit
warning: unused manifest key: package.metadata.release.upload-doc
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling hyper v0.9.10
   Compiling iron v0.4.0
   Compiling handlebars-iron v0.15.4-pre (file:///Users/ben/dev/handlebars-iron)
examples/server.rs:141:10: 141:13 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {index}` implements the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]
examples/server.rs:141         .get("/", index)
                                ^~~
examples/server.rs:141:10: 141:13 help: run `rustc --explain E0281` to see a detailed explanation
examples/server.rs:141:10: 141:13 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {index}`
examples/server.rs:141:10: 141:13 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {index}` implements the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]
examples/server.rs:141         .get("/", index)
                                ^~~
examples/server.rs:141:10: 141:13 help: run `rustc --explain E0281` to see a detailed explanation
examples/server.rs:141:10: 141:13 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {index}`
examples/server.rs:142:10: 142:13 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {memory}` implements the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]
examples/server.rs:142         .get("/mem", memory)
                                ^~~
examples/server.rs:142:10: 142:13 help: run `rustc --explain E0281` to see a detailed explanation
examples/server.rs:142:10: 142:13 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {memory}`
examples/server.rs:142:10: 142:13 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {memory}` implements the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]
examples/server.rs:142         .get("/mem", memory)
                                ^~~
examples/server.rs:142:10: 142:13 help: run `rustc --explain E0281` to see a detailed explanation
examples/server.rs:142:10: 142:13 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {memory}`
examples/server.rs:143:10: 143:13 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {temp}` implements the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]
examples/server.rs:143         .get("/temp", temp);
                                ^~~
examples/server.rs:143:10: 143:13 help: run `rustc --explain E0281` to see a detailed explanation
examples/server.rs:143:10: 143:13 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {temp}`
examples/server.rs:143:10: 143:13 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {temp}` implements the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]
examples/server.rs:143         .get("/temp", temp);
                                ^~~
examples/server.rs:143:10: 143:13 help: run `rustc --explain E0281` to see a detailed explanation
examples/server.rs:143:10: 143:13 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {temp}`
examples/server.rs:144:21: 144:31 error: the trait bound `for<'r, 'r, 'r> router::Router: std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied [E0277]
examples/server.rs:144     let mut chain = Chain::new(router);
                                           ^~~~~~~~~~
examples/server.rs:144:21: 144:31 help: run `rustc --explain E0277` to see a detailed explanation
examples/server.rs:144:21: 144:31 note: required because of the requirements on the impl of `iron::Handler` for `router::Router`
examples/server.rs:144:21: 144:31 note: required by `iron::Chain::new`
examples/server.rs:144:21: 144:31 error: the trait bound `for<'r, 'r, 'r> router::Router: std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied [E0277]
examples/server.rs:144     let mut chain = Chain::new(router);
                                           ^~~~~~~~~~
examples/server.rs:144:21: 144:31 help: run `rustc --explain E0277` to see a detailed explanation
examples/server.rs:144:21: 144:31 note: required because of the requirements on the impl of `iron::Handler` for `router::Router`
examples/server.rs:144:21: 144:31 note: required by `iron::Chain::new`
error: aborting due to 8 previous errors
error: Could not compile `handlebars-iron`.

To learn more, run the command again with --verbose.
sunng87 commented 7 years ago

It works for me. Did you run cargo update?

gnunicorn commented 7 years ago

Sorry, I was trying against master || release and I missed the update of router. Examples work fine then (release still doesn't though :( )

sunng87 commented 7 years ago

Yes, because handlebars 0.19 has a little backward incompatible change. I'm planning a few releases to cover (iron 0.3 + handlerbars 0.19) and (iron 0.4 + handlebars 0.19).

tl;dr I will release it tonight.