Skip to content

Commit 28beb81

Browse files
committed
Merge commit 'b23b69900eab1260be510b2bd8922f4b6de6cf1e' into sync-from-rustfmt
1 parent e1712ea commit 28beb81

File tree

196 files changed

+4708
-1556
lines changed

Some content is hidden

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

196 files changed

+4708
-1556
lines changed

.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: |

.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

.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

.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

.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: |

.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

.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

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

Cargo.lock

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "rustfmt-nightly"
4-
version = "1.7.1"
4+
version = "1.8.0"
55
description = "Tool to find and fix Rust formatting issues"
66
repository = "https://github.com/rust-lang/rustfmt"
77
readme = "README.md"
@@ -50,7 +50,7 @@ serde_json = "1.0"
5050
term = "0.7"
5151
thiserror = "1.0.40"
5252
toml = "0.7.4"
53-
tracing = "0.1.37"
53+
tracing = { version = "0.1.37", default-features = false, features = ["std"] }
5454
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
5555
unicode-segmentation = "1.9"
5656
unicode-width = "0.1"

0 commit comments

Comments
 (0)