nickel-org / nickel.rs

An expressjs inspired web framework for Rust

Home Page:http://nickel-org.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't build fresh nickel project

cburgdorf opened this issue · comments

It seems there's something broken with nickel right now.

I wanted to start a fresh project basically to create repro steps for an issue with rust-mustache that I reported a while back. But when I try to set up a fresh nickel project I get.

/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:22:26: 22:57 error: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:22         let nickel_req = request::Request::from_internal(req);
                                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:21:5: 26:6 help: consider using an explicit lifetime parameter as shown: fn handle<'a>(&'a self, req: Request<'a, 'a>, res: Response<'a>)
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:21     fn handle<'a, 'k>(&'a self, req: Request<'a, 'k>, res: Response<'a>) {
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:22         let nickel_req = request::Request::from_internal(req);
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:23         let nickel_res = response::Response::from_internal(res, &self.0.templates);
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:24 
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:25         self.0.middleware_stack.invoke(nickel_req, nickel_res);
/Users/cburgdorf/.cargo/registry/src/github.com-0a35038f75765ae4/nickel-0.6.0/src/server.rs:26     }
error: aborting due to previous error
Co

I get this even if all my main.rs has is:

#[macro_use]
extern crate nickel;

use nickel::*

fn main() {
}

I just ran into this as well.
I tried rustc:
nightly-2015-08-15
nightly-2015-09-01

both failed with the same error.

Solution:

  • edit Cargo.toml so the nickel dependency info is:

[dependencies.nickel]
git = "https://github.com/nickel-org/nickel.rs.git"
features = ["unstable"]

Note: I'm using a nightly version of Rust. You probably don't have to if you comment out the features.

Ah, damn it. Thanks @MarkSwanson, I forgot that I switched to nightly a couple of days ago. This bug doesn't exist when compiled with stable rust. I'm closing this for now then.