【发布时间】:2021-05-23 18:47:27
【问题描述】:
我尝试更新到 actix_rt 2.0.2 并收到以下错误:
线程“主”因“系统未运行”而恐慌
我的最小例子在这里
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
}
cargo.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"
我假设这一定是 actix 板条箱之间的某些版本不兼容。是否有版本号的组合或我缺少的一些明显的东西才能让它们一起工作?
我需要 actix_rt 2.0.x 以便与 Criterion 集成
提前感谢您的任何见解。
干杯!
【问题讨论】:
标签: compiler-errors actix-web rust-actix