"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
The original idea here was to make sure, on CI, that line endings are
\n. Travis however uses autocrlf, so the check doesn't actually work,
and forcing \n otherwise makes lives of windows folks difficult
closes#2157
This wasn't a right decision in the first place, the feature flag was
broken in the last rustfmt release, and syntax highlighting of imports
is more important anyway