Skip to content

panic with cannot crate the crate graph on master #20879

@RoloEdits

Description

@RoloEdits

On the latest master, running rust-analyzer analysis-stats --run-all-ide-things -q . within the rust-analyzer repo panics with:

thread 'main' (15572) panicked at crates/test-fixture/src/lib.rs:341:35:
no entry found for key
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2025-10-20T15:18:00.345108169-07:00 ERROR cannot crate the crate graph: no entry found for key
Crate graph:
//- toolchain: nightly
//- proc_macros: identity
//- minicore: coerce_unsized
//- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b,atom env:OUTDIR=path/to,OTHER=foo
mod m;

thread 'main' (15572) panicked at crates/test-fixture/src/lib.rs:310:18:
missing default crate root, specify a main.rs or lib.rs
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2025-10-20T15:18:04.635186833-07:00 ERROR cannot crate the crate graph: missing default crate root, specify a main.rs or lib.rs
Crate graph:
//- /a.rs
fn t() {}

thread 'main' (15572) panicked at crates/test-fixture/src/lib.rs:310:18:
missing default crate root, specify a main.rs or lib.rs
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2025-10-20T15:18:04.64033782-07:00 ERROR cannot crate the crate graph: missing default crate root, specify a main.rs or lib.rs
Crate graph:
//- /parser/__mod.rs
fn test() {}
mod expr;
//- /parser/expr.rs
struct A {}

thread 'main' (15572) panicked at crates/test-fixture/src/lib.rs:310:18:
missing default crate root, specify a main.rs or lib.rs
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2025-10-20T15:18:04.645789619-07:00 ERROR cannot crate the crate graph: missing default crate root, specify a main.rs or lib.rs
Crate graph:
//- /foo.rs
mod bar {
mod baz {
mod qux;
}
}
//- /foo/bar/baz/qux.rs

thread 'main' (15572) panicked at crates/test-fixture/src/lib.rs:310:18:
missing default crate root, specify a main.rs or lib.rs
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2025-10-20T15:18:04.647287337-07:00 ERROR cannot crate the crate graph: missing default crate root, specify a main.rs or lib.rs
Crate graph:
//- /foo/mod.rs
mod r#mod;
//- /foo/mod/mod.rs

There might be more. There is also a ERROR cannot insert true or false to cfg message that comes up a lot, unsure if related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-supportCategory: support questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions