Commit 7185158
committed
Fix rustfmt for files that use 2024-edition syntax
"cargo fmt" works fine but "rustfmt" fails to format some files.
$ rustfmt crates/ide-db/src/search.rs
error: let chains are only allowed in Rust 2024 or later
--> /home/johannes/git/rust-analyzer/crates/ide-db/src/search.rs:298:12
|
298 | if let &Definition::Module(module) = self
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I guess I could work around this by setting my format command to
"cargo fmt -- $filename" instead of "rustfmt $filename".
But it'd be nice if this worked OOTB. Make it so by adding specifying
the edition in rustfmt.toml. We already have several other places
specifying the edition.
changelog internal1 parent 6e397d3 commit 7185158
File tree
3 files changed
+167
-822
lines changed- src/tools/rust-analyzer
- crates/syntax/src/ast/generated
3 files changed
+167
-822
lines changed
0 commit comments