|
1 | 1 | # Changelog
|
2 | 2 |
|
3 |
| -## [Unreleased] |
| 3 | +## [1.8.0] 2024-09-20 |
| 4 | + |
| 5 | +### Fixed |
| 6 | +- Fix issue where rustfmt would crash on Windows when using the `ignore` option [#6178](https://github.com/rust-lang/rustfmt/issues/6178) |
| 7 | + |
| 8 | +### Changed |
| 9 | +- `rustfmt --version` now prints a commit hash that is 10 characters long [#6258](https://github.com/rust-lang/rustfmt/pull/6258) |
| 10 | +- `rustfmt --version` will no longer print empty git information when git information isn't available at build time. |
| 11 | + For example, git information is not available when building rustfmt from a source tarball [#6266](https://github.com/rust-lang/rustfmt/pull/6266) |
| 12 | +- `version` has been soft deprecated and replaced by `style_edition`. |
| 13 | + `style_edition=2024` is equivalent to `version=Two` and `style_edition={2015|2018|2021}` |
| 14 | + are equivalent to `version=One` [#6247](https://github.com/rust-lang/rustfmt/pull/6247) |
| 15 | +- When `style_edition=2024` is configured `overflow_delimited_expr` will default to `true` [#6260](https://github.com/rust-lang/rustfmt/pull/6260). |
| 16 | + ```rust |
| 17 | + // with style_edition=2015 |
| 18 | + do_thing( |
| 19 | + x, |
| 20 | + Bar { |
| 21 | + x: value, |
| 22 | + y: value2, |
| 23 | + }, |
| 24 | + ); |
| 25 | + |
| 26 | + // with style_edition=2024 |
| 27 | + do_thing(x, Bar { |
| 28 | + x: value, |
| 29 | + y: value2, |
| 30 | + }); |
| 31 | + ``` |
| 32 | +- When `style_edition=2024` is configured rustfmt will apply the [style guide's version sorting algorithm] |
| 33 | + when sorting imports [#6284](https://github.com/rust-lang/rustfmt/pull/6284) |
| 34 | + ```rust |
| 35 | + // with style_edition=2015 |
| 36 | + use std::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8}; |
| 37 | + |
| 38 | + // with style_edition=2024 |
| 39 | + use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64}; |
| 40 | + ``` |
| 41 | + [style guide's version sorting algorithm]: https://doc.rust-lang.org/nightly/style-guide/#sorting |
| 42 | +- When parsing rustfmt configurations fails, rustfmt will now include the path to the toml file in the erorr message [#6302](https://github.com/rust-lang/rustfmt/issues/6302) |
| 43 | + |
| 44 | +### Added |
| 45 | +- rustfmt now formats trailing where clauses in type aliases [#5887](https://github.com/rust-lang/rustfmt/pull/5887) |
| 46 | + ```rust |
| 47 | + type Foo |
| 48 | + = Bar |
| 49 | + where |
| 50 | + A: B, |
| 51 | + C: D; |
| 52 | + ``` |
| 53 | +- Users can now configure which `style_edition` rustfmt uses when formatting their code as specified |
| 54 | + in [RFC 3338](https://rust-lang.github.io/rfcs/3338-style-evolution.html). Users are encouraged to configure `style_edition` |
| 55 | + in their `rustfmt.toml` files, but the value can also be specified via the cli with `--unstable-features --style-edition={style_edition}`. |
| 56 | + When `style_edition` is not explicitly configured it will be inferred from the `edition` configuration. |
| 57 | + When neither `style_edition` nor `edition` are configured `style_edition` defaults to `2015` [#6247](https://github.com/rust-lang/rustfmt/pull/6247) |
| 58 | + |
| 59 | +### Misc |
| 60 | +- Removed `tracing-attributes` dependency [#6208](https://github.com/rust-lang/rustfmt/pull/6208) |
| 61 | +- Reduced syn's features in the internal `config_proc_macro` crate [#6237](https://github.com/rust-lang/rustfmt/pull/6237) |
| 62 | + |
| 63 | +## [1.7.1] 2024-06-24 |
4 | 64 |
|
5 | 65 | ### Fixed
|
6 | 66 |
|
|
238 | 298 |
|
239 | 299 | ### Added
|
240 | 300 |
|
241 |
| -- New configuration option (`skip_macro_invocations`)[https://rust-lang.github.io/rustfmt/?version=master&search=#skip_macro_invocations] [#5347](https://github.com/rust-lang/rustfmt/pull/5347) that can be used to globally define a single enumerated list of macro calls that rustfmt should skip formatting. rustfmt [currently also supports this via a custom tool attribute](https://github.com/rust-lang/rustfmt#tips), however, these cannot be used in all contexts because [custom inner attributes are unstable](https://github.com/rust-lang/rust/issues/54726) |
| 301 | +- New configuration option [`skip_macro_invocations`](https://rust-lang.github.io/rustfmt/?version=master&search=#skip_macro_invocations) [#5347](https://github.com/rust-lang/rustfmt/pull/5347) that can be used to globally define a single enumerated list of macro calls that rustfmt should skip formatting. rustfmt [currently also supports this via a custom tool attribute](https://github.com/rust-lang/rustfmt#tips), however, these cannot be used in all contexts because [custom inner attributes are unstable](https://github.com/rust-lang/rust/issues/54726) |
242 | 302 |
|
243 | 303 | ### Misc
|
244 | 304 |
|
|
0 commit comments