Skip to content

Compiler panic: found unstable fingerprints for extern_mod_stmt_cnum #83439

Closed
@crone123

Description

@crone123

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions