Skip to content

Commit eeda9dd

Browse files
committed
Merge commit 'b23b69900eab1260be510b2bd8922f4b6de6cf1e' into sync-from-rustfmt
2 parents 506f22b + b23b699 commit eeda9dd

File tree

197 files changed

+4709
-1557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+4709
-1557
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4630,7 +4630,7 @@ dependencies = [
46304630

46314631
[[package]]
46324632
name = "rustfmt-nightly"
4633-
version = "1.7.1"
4633+
version = "1.8.0"
46344634
dependencies = [
46354635
"annotate-snippets 0.9.2",
46364636
"anyhow",

src/tools/rustfmt/.github/workflows/check_diff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
- name: install rustup
2727
run: |

src/tools/rustfmt/.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
steps:
6666
- name: checkout
67-
uses: actions/checkout@v3
67+
uses: actions/checkout@v4
6868

6969
# Run build
7070
- name: install rustup

src/tools/rustfmt/.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030

3131
# Run build
3232
- name: install rustup

src/tools/rustfmt/.github/workflows/mac.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
jobs:
99
test:
1010
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
11-
# macOS Catalina 10.15
1211
runs-on: macos-latest
1312
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
1413
env:
@@ -23,7 +22,7 @@ jobs:
2322

2423
steps:
2524
- name: checkout
26-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2726

2827
# Run build
2928
- name: install rustup

src/tools/rustfmt/.github/workflows/rustdoc_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: rustdoc check
1212
steps:
1313
- name: checkout
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
- name: install rustup
1717
run: |

src/tools/rustfmt/.github/workflows/upload-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
target: x86_64-pc-windows-msvc
3232
runs-on: ${{ matrix.os }}
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535

3636
# Run build
3737
- name: install rustup

src/tools/rustfmt/.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: disable git eol translation
3434
run: git config --global core.autocrlf false
3535
- name: checkout
36-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3737

3838
# Run build
3939
- name: Install Rustup using win.rustup.rs

src/tools/rustfmt/CHANGELOG.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,66 @@
11
# Changelog
22

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
464

565
### Fixed
666

@@ -238,7 +298,7 @@
238298

239299
### Added
240300

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)
242302

243303
### Misc
244304

src/tools/rustfmt/Cargo.lock

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ dependencies = [
499499

500500
[[package]]
501501
name = "rustfmt-nightly"
502-
version = "1.7.1"
502+
version = "1.8.0"
503503
dependencies = [
504504
"annotate-snippets",
505505
"anyhow",
@@ -710,21 +710,9 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
710710
dependencies = [
711711
"cfg-if",
712712
"pin-project-lite",
713-
"tracing-attributes",
714713
"tracing-core",
715714
]
716715

717-
[[package]]
718-
name = "tracing-attributes"
719-
version = "0.1.26"
720-
source = "registry+https://github.com/rust-lang/crates.io-index"
721-
checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
722-
dependencies = [
723-
"proc-macro2",
724-
"quote",
725-
"syn",
726-
]
727-
728716
[[package]]
729717
name = "tracing-core"
730718
version = "0.1.31"

0 commit comments

Comments
 (0)