Closed Sherlock-Holo closed 2 months ago
I observed the same issue. The second kind of change you can revert using:
overflow_delimited_expr=false
I couldn't find a way to fix import change. I think this is connected with introducing option style_edition="2024"
which introduced new sorting algorithm. Unfortunately changing style_editon to <= 2021 does not fix the issue (I think it behaves like version="one" then and changes a.0.0
to a.0 .0
)
These changes are expected when using version=Two
or style_edition=2024
. You can take a look at the release notes for information on what changed.
So basically there is no way to keep previous settings and we need to reformat whole code base when upgrading rust toolchain. Using style_edition=2021 or 2015 reformats other stuff (tuple nested accessors).
This is far from ideal.
pon., 23 wrz 2024, 15:26 użytkownik Yacin Tmimi @.***> napisał:
These changes are expected when using version=Two or style_edition=2024. You can take a look at the release notes for information on what changed https://github.com/rust-lang/rustfmt/blob/master/CHANGELOG.md#changed.
— Reply to this email directly, view it on GitHub https://github.com/rust-lang/rustfmt/issues/6346#issuecomment-2368242976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXNOECPVXDWSLKHTYTE3DZYAJHTAVCNFSM6AAAAABOV3G2YOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYGI2DEOJXGY . You are receiving this because you commented.Message ID: @.***>
Anyone that was using the unstable version
option with the Two
value was explicitly opting in to unstable formatting that could potentially be changed with every single nightly release.
That's the choice that you'd voluntarily made before, and that dynamic, unstable formatting has changed. rustfmt has a stability guarantee that ensures stable, default formatting doesn't change, but that's not applicable here.
If you feel strongly enough about the old sorting algorithm and would like to have the option to utilize it over the new algorithm that the Style Guide now prescribes then I'd encourage you to open a feature request, and consider opening a PR.
Tangentially, I will also refer back to a note mentioned in the Style Guide evolution RFC that suggested the usage of git's blame.ignoreRevsFile as a method of helping to hiding these changes in tooling
with previous version, for example:
cargo +nightly-2024-09-15 fmt
it only changes one file
however, with 1.8.0-nightly (6c6d210089 2024-09-22) this version, it changes a lot of files:
all of these diff like:
also there are other kind change, like
Is this an expected behavioral change?