Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Cargo from `rustup which` is broken

Aperta
#4,537 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
tooling

Direzione di ricerca

Riproducete il comportamento usando rustup which cargo e il comando Cargo diretto mostrato, quindi confrontatelo con l’invocazione predefinita di Cargo. Leggete il comportamento di rust-toolchain.toml nella dipendenza dashmap e l’uso di evcxr citato nel report. Il lavoro è completato quando lo stato di supporto dell’esecuzione diretta di quel percorso è chiaro e documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have hit a strange issue where using cargo reported by rustup which doesn't work. When building dashmap crate it downloads rust 1.65 and tries to build with that but it fails. Even if it succeeded how would it be possible to link crate built with 1.65 with all the other crates built with the latest version?

I'm not sure if this is a rustup or cargo issue.

Here are the exact steps:

Create new crate:

PS D:\test> cargo new project
    Creating binary (application) `project` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
PS D:\test> cd project

Add dashmap v6.1.0 as a dependency:

PS D:\test\project> cargo add [email protected]
    Updating crates.io index
      Adding dashmap v6.1.0 to dependencies
             Features:
             - arbitrary
             - inline
             - raw-api
             - rayon
             - serde
             - typesize
    Updating crates.io index
     Locking 13 packages to latest Rust 1.92.0-nightly compatible versions

Find out cargo location:

PS D:\test\project> rustup which cargo
C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo.exe

Build with the provided cargo:

PS D:\test\project> C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo.exe build
   Compiling crossbeam-utils v0.8.21
   Compiling parking_lot_core v0.9.12
   Compiling scopeguard v1.2.0
   Compiling windows-link v0.2.1
   Compiling smallvec v1.15.1
   Compiling cfg-if v1.0.4
   Compiling once_cell v1.21.3
   Compiling hashbrown v0.14.5
   Compiling lock_api v0.4.14
   Compiling dashmap v6.1.0
info: syncing channel updates for '1.65-x86_64-pc-windows-msvc'
info: latest update on 2022-11-03, rust version 1.65.0 (897e37553 2022-11-02)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
error: the `-Z unstable-options` flag must also be passed to enable the flag `check-cfg`

error: could not compile `dashmap` (lib)

Caused by:
  process didn't exit successfully: `rustc --crate-name dashmap --edition=2018 C:\Users\user\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\dashmap-6.1.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=119 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --check-cfg cfg(docsrs,test) --check-cfg "cfg(feature, values(\"arbitrary\", \"inline\", \"raw-api\", \"rayon\", \"serde\", \"typesize\"))" -C metadata=7088beb6e94b1ca5 -C extra-filename=-e6076f9687df7ba4 --out-dir D:\test\project\target\debug\deps -L dependency=D:\test\project\target\debug\deps --extern cfg_if=D:\test\project\target\debug\deps\libcfg_if-c6c59aeea06f958d.rmeta --extern crossbeam_utils=D:\test\project\target\debug\deps\libcrossbeam_utils-96db4feb57c79985.rmeta --extern hashbrown=D:\test\project\target\debug\deps\libhashbrown-aeca10d661ea0b2e.rmeta --extern lock_api=D:\test\project\target\debug\deps\liblock_api-04e31afff8092457.rmeta --extern once_cell=D:\test\project\target\debug\deps\libonce_cell-ecc86b59685e8d56.rmeta --extern parking_lot_core=D:\test\project\target\debug\deps\libparking_lot_core-e8be9b060a8eb8f9.rmeta --cap-lints allow` (exit code: 1)

Building with the default cargo (C:\Users\user\.cargo\bin\cargo.exe) does work. I was executing cargo from rustup which because this is what evcxr does. If this cargo is not meant to be executed directly than it should be documented somewhere.

dashmap contains rust-toolchain.toml with channel = "1.65", that's probably why rustup downloads rust 1.65.


rustup 1.28.2 (e4f3ad6f8 2025-04-28)
rustc 1.92.0-nightly (844264add 2025-10-14)

Lingua principale
Rust
Stelle
7.1k
Fork
1.1k
Merge medio
1g 6h
PR unite (30g)
45

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rustup

Tutte le issue di rust-lang/rustup

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.