`RustFmt` error: "let chains are only allowed in Rust 2024 or later" but I'm on 2024
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by reading the :RustFmt implementation and how it selects the Rust file’s edition; compare that behavior with cargo fmt on the workspace and crate-level edition configurations described in the report. Reproduce with a crate using let chains and edition 2024, then check whether the command works with an explicit crate edition. Done when :RustFmt formats the file without the Rust 2024 edition error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Project setup: I have a workspace that specifies the project versions, rust editions, and dependencies in the workspace Cargo.toml, and the crates contained within use:
version.workspace = true
edition.workspace = true
...
etc to refer to the configuration in the workspace Cargo.toml. I'm using edition "2024".
Vim setup: I'm on vim 8.2. rust.vim is already on its newest version. Here are the versions reported by :RustInfo.
rustfmt 1.8.0-stable (1159e78c47 2025-09-14)
rustc 1.90.0 (1159e78c4 2025-09-14)
cargo 1.90.0 (840b83a10 2025-07-30)
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 02 2025 12:39:01)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1
970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
Modified by [email protected]
Compiled by [email protected]
Issue: Running :RustFmt on a rust file that's using let chains fails with a location list of errors saying:
error: let chains are only allowed in Rust 2024 or later
The issue still reproduces this issue by using edition = "2024" on the crate instead of referring to the workspace edition. But cargo fmt on the command line works just fine. cargo fmt will produce the error above if I change to edition = "2018", for example. So rust.vim seems to not see the version correctly.
Any insights on what the underlying issue is and how to resolve it?
- Lingua principale
- Vim Script
- Stelle
- 4.2k
- Fork
- 323
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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.
Altre issue di rust-lang/rust.vim
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
-
It's Dead, Jim!Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
Remove hard coded edition fallbackForse già presa @alerque l’ha presa 230 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
-
README.md syntastic to aleAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 43/100
Tutte le issue di rust-lang/rust.vim
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
mglaman/phpstan-drupal#1078 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)Forse già presa @rohit-jsfreaky l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#5110 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
voyageurworks/launch-guard-pack#29 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
bigbio/sdrf-pipelines#372 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno