-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
/*
The code below can be used to reproduce the error on stable-x86_64-unknown-linux-gnu
The build process failed with an out-of-memory error on stable but builds okay on nightly.
My machine has a RAM capacity of 11.6GiB and a 2GiB swap memory capacity. Before build 6.8GiB RAM and 336.0MiB of swap memory is in use. During build, the RAM and swap memory usage rises in an almost linear manner during the final build phase.
Cargo.toml
=========
[dependencies]
mongodb = "1.1"
actix-web = "3"
main.rs
======
*/
use actix_web::
{get, web, App, HttpResponse, HttpServer};
use mongodb::
;
pub struct AppState
{ pub db: Database, }#[get("/test")]
async fn test(state: web::Data<AppState>) -> HttpResponse
#[actix_web::main]
async fn main() -> Result<(), std::io::Error> {
let result = Client::with_uri_str("mongodb://localhost:27017/").await;
let client = result.expect("Failed to connect!");
HttpServer::new(move || {
App::new()
.data(AppState
)
.service(test)
})
.bind("127.0.0.1:8080")?
.run()
.await
}
- is duplicated by
-
RUST-558 Unable to compile with tokio runtime
-
- Closed
-