Mar*_*ick 9 compiler-errors rust-actix actix-web
我尝试更新到 actix_rt 2.0.2,但一直收到以下错误:
线程“main”因“系统未运行”而恐慌
我的最小例子在这里
use actix_rt;
use actix_web::{HttpServer, App, HttpResponse};
async fn hello() -> HttpResponse {
HttpResponse::Ok().finish()
}
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
let server = HttpServer::new(move || {
App::new().route("/", actix_web::web::get().to(hello))
});
server.bind("127.0.0.1:8080")?.run().await
}
Run Code Online (Sandbox Code Playgroud)
货物.toml
[package]
name = "my_app"
version = "2.2.0"
authors = ["me"]
edition = "2018"
[dependencies]
actix = "0.10"
actix-web = { version = "3.3.2", default-features = false }
actix-rt = "2.0.2"
Run Code Online (Sandbox Code Playgroud)
我假设它一定是actix板条箱之间的某些版本不兼容。是否有版本号的组合或我缺少的一些明显的东西来让它们一起工作?
我需要 actix_rt 2.0.x 以便我可以与Criterion集成
提前感谢您的任何见解。
干杯!
Max*_*Max 10
您的 actix crate 版本不兼容。您可以降级actix-rt到1,或升级到测试版,例如:
actix = "0.11.0-beta.2"
actix-web = "4.0.0-beta.3"
actix-rt = "2.0.2"
Run Code Online (Sandbox Code Playgroud)