os: Ubuntu 18.04
rust version: rustc 1.38.0-nightly (4b65a86eb 2019-07-15
Compiling tide v0.2.0
error[E0658]: async closures are unstable
--> /home/wpf/.cargo/registry/src/github.com-1ecc6299db9ec823/tide-0.2.0/src/app.rs:312:28
|
312 | router.at("/").get(async move |_| "/");
| ^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/62290
= help: add `#![feature(async_closure)]` to the crate attributes to enable
I had tried as compiler prompt but it not works.
#![feature(async_closure)]
fn main() {
println!("Hello, world!");
}
As follows #289, the async closure feature has been removed from the library -- but you can essentially have the same behavior through just passing in a regular closure and putting your logic into an async move block.
This will likely be the recommended way to do it for now, until the status of that feature changes
I think we need to release the next version (because tide 0.2 uses it and cannot be compiled in nightly-2019-07-08 or later.). but probably that blocked by next release of http-service (see https://github.com/rustasync/tide/pull/288#issuecomment-511214379)
cc @yoshuawuyts
Also, by copying the following block to your Cargo.toml, you can prepare for the new release.
[patch.crates-io]
tide = { git = "https://github.com/rustasync/tide", branch = "master" }
http-service = { git = "https://github.com/rustasync/http-service", branch = "master" }
http-service-hyper = { git = "https://github.com/rustasync/http-service", branch = "master" }
http-service-mock = { git = "https://github.com/rustasync/http-service", branch = "master" }
Also, by copying the following block to your
Cargo.toml, you can prepare for the new release.[patch.crates-io] tide = { git = "https://github.com/rustasync/tide", branch = "master" } http-service = { git = "https://github.com/rustasync/http-service", branch = "master" } http-service-hyper = { git = "https://github.com/rustasync/http-service", branch = "master" } http-service-mock = { git = "https://github.com/rustasync/http-service", branch = "master" }
Thank you !! It works.
This took me a good while to find and was exactly what I needed.
Most helpful comment
Also, by copying the following block to your
Cargo.toml, you can prepare for the new release.