Closed
Description
Problem
thread 'main' panicked at src/tools/cargo/src/cargo/ops/cargo_compile/unit_generator.rs:302:26:
The number of packages must be at least 1
stack backtrace:
3: core::option::expect_failed
at /rustc/13e87909494f2f31bce51bc106e2b629420d1235/library/core/src/option.rs:2049:5
4: <cargo::ops::cargo_compile::unit_generator::UnitGenerator>::list_rule_targets
5: <cargo::ops::cargo_compile::unit_generator::UnitGenerator>::generate_root_units
6: cargo::ops::cargo_compile::create_bcx
7: cargo::ops::cargo_compile::compile_ws
8: cargo::ops::cargo_compile::compile_with_exec
9: cargo::ops::cargo_compile::compile
10: cargo::commands::rustc::exec
11: <cargo::cli::Exec>::exec
12: cargo::main
Steps
cargo new cargo-bug
cd cargo-bug
mkdir src/bin
cargo rustc --bin main
Possible Solution(s)
No response
Notes
No response
Version
cargo 1.88.0-nightly (7918c7eb5 2025-04-27)
release: 1.88.0-nightly
commit-hash: 7918c7eb59614c39f1c4e27e99d557720976bdd7
commit-date: 2025-04-27
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.4.1)
ssl: OpenSSL 3.4.1 11 Feb 2025
os: Pop!_OS 22.4.0 (jammy) [64-bit]