rust-lang / rust-lang/rust-analyzer
target selection for per-project rust-analyzer.toml does not seem to work
Nessuno ha ancora preso questa issue.
- Lingua principale
- Rust
- Stelle
- 16.9k
- Fork
- 2.2k
- Merge medio
- 1g 12h
- PR unite (30g)
- 72
Descrizione
rust-analyzer version: rust-analyzer 1.96.0 (ac68faa 2026-05-25)
rustc version: rustc 1.96.0 (ac68faa20 2026-05-25)
editor or extension: neovim v0.12.2
relevant settings:
rust-analyzer.toml at root of project:
[cargo]
allTargets = false
target = "wasm32-unknwon-unknown"
code snippet to reproduce:
#[cfg(target_arch = "wasm32")]
fn main() {
}
-
Neovim configuration has an inline check that tells me the wasm32 target_arch is disabled. Downstream dependencies also do not have this feature enabled.
-
Does not seem like there are bugs tracking the fact that the
targetconfiguration does not appear to work in cargo. -
Other options seem to be fine (e.g.
checkconfigurations), but anything underneathcargoseems to be ignore. -
Would be nice to get this feature working (or make a note that it is not supported in https://rust-analyzer.github.io/book/configuration.html.
-
Working a in a project with mixed targets (wasm32 for frontend, aarch64 for backend) pretty much requires the ability to provide a per-project or per-crate rust-analyzer.toml file so code completion will work properly.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il problema con la rust-analyzer.toml root contenente [cargo] allTargets = false e target = "wasm32-unknwon-unknown", usando lo snippet cfg wasm32 fornito in Neovim. Traccia come vengono caricate le impostazioni cargo specifiche del progetto e passate all’analisi della destinazione, quindi verifica che completion e la diagnostica cfg riconoscano la destinazione selezionata; se non è supportato, aggiorna invece la documentazione della configurazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- developer-experience, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100