You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 internal
0 commit comments