Closed
Description
Code
use actix_web::{HttpServer,App};
mod fighter;
mod controller;
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.service(controller::hello)
})
.bind("[::]:4000")?
.run()
.await
}
fighter:
use serde::{Serialize,Deserialize};
#[derive(Serialize,Deserialize)]
pub struct Fighter
{
pub id: Option<String>,
pub name: String,
pub first_name: String,
pub r#type: String,
pub avatar: Option<String>,
pub biography: String,
}
controller:
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
#[get("/")]
pub async fn hello() -> impl Responder {
"Hello world !"
}
with these dependencies:
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.64"
mongodb = "1.2.0"
lapin = "1.6.8"
actix-web = "3"
Meta
rustc --version --verbose
:
rustc 1.52.0-nightly (107896c32 2021-03-15)
binary: rustc
commit-hash: 107896c32d5dda4db508968ff34997a39d286966
commit-date: 2021-03-15
host: x86_64-apple-darwin
release: 1.52.0-nightly
LLVM version: 12.0.0
Error output
Compiling packagename v0.1.0 (/path)
warning: unused imports: `App`, `HttpResponse`, `HttpServer`, `post`, `web`
--> src/controller.rs:1:22
|
1 | use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
| ^^^^ ^^^ ^^^ ^^^^^^^^^^^^ ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
thread 'rustc' panicked at 'found unstable fingerprints for extern_mod_stmt_cnum(poc_rust[66d3]::fighter::_::_serde)', /rustc/107896c32d5dda4db508968ff34997a39d286966/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.52.0-nightly (107896c32 2021-03-15) running on x86_64-apple-darwin
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [extern_mod_stmt_cnum] computing crate imported by `fighter::_::_serde`
#1 [check_mod_unstable_api_usage] checking for unstable API usage in module `fighter`
end of query stack
warning: 1 warning emitted
error: could not compile
Backtrace
<backtrace>
Note: I comment some parts of the code (mod, etc...) and it compiles. After this, I run this previous code again, and it works, I don't know why.