Skip to content

Commit bc18a72

Browse files
authored
Merge branch 'master' into master
2 parents cc9b52d + 16f0ecc commit bc18a72

File tree

224 files changed

+5633
-1988
lines changed

Some content is hidden

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

224 files changed

+5633
-1988
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
matrix:
2020
integration: [
2121
bitflags,
22-
error-chain,
2322
log,
2423
mdbook,
2524
packed_simd,
@@ -65,7 +64,7 @@ jobs:
6564

6665
steps:
6766
- name: checkout
68-
uses: actions/checkout@v3
67+
uses: actions/checkout@v4
6968

7069
# Run build
7170
- 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: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,101 @@
22

33
## [Unreleased]
44

5+
## [1.7.1] 2024-06-24
6+
7+
### Fixed
8+
9+
- Fix an idempotency issue when rewriting where clauses in which rustfmt would continuously add a trailing comma `,` to the end of trailing line comments [#5941](https://github.com/rust-lang/rustfmt/issues/5941).
10+
- Prevent enum variant attributes from wrapping one character early when using `version=Two` [#5801](https://github.com/rust-lang/rustfmt/issues/5801)
11+
- Properly wrap macro matchers at the `max_width` when using `version=Two` and `format_macro_matchers=true` [#3805](https://github.com/rust-lang/rustfmt/issues/3805)
12+
- Prevent panic when formatting trait declaration with non [Unicode Normalization Form] C (NFC) identifiers [#6069](https://github.com/rust-lang/rustfmt/issues/6069)
13+
```rust
14+
// The ó below is two codepoints, ASCII o followed by U+0301 COMBINING ACUTE ACCENT.
15+
// It NFC-normalizes to ó, U+00F3 LATIN SMALL LETTER O WITH ACUTE.
16+
trait Foó: Bar {}
17+
```
18+
[unicode normalization form]: https://unicode.org/reports/tr15/
19+
- Ensure a space is added to a range expression, when the right hand side of the range expression is a binary expression that ends with a trailing period [#6059](https://github.com/rust-lang/rustfmt/issues/6059)
20+
```rust
21+
let range = 3. / 2. ..4.;
22+
```
23+
- When using `version=Two`, comments in match arms that contain `=>` no longer prevent formatting [#5998](https://github.com/rust-lang/rustfmt/issues/5998)
24+
```rust
25+
match a {
26+
_ =>
27+
// comment with =>
28+
{
29+
println!("A")
30+
}
31+
}
32+
```
33+
- Prevent panics when formatting input that contains the expanded form of `offset_of!` [#5885](https://github.com/rust-lang/rustfmt/issues/5885) [#6105](https://github.com/rust-lang/rustfmt/issues/6105)
34+
```rust
35+
const _: () = builtin # offset_of(x, x);
36+
```
37+
- When using `version=Two` inner attributes in `match` expressions are correctly indented [#6147](https://github.com/rust-lang/rustfmt/issues/6147)
38+
```rust
39+
pub fn main() {
40+
match x {
41+
#![attr1]
42+
#![attr2]
43+
_ => (),
44+
}
45+
}
46+
```
47+
- Output correct syntax for type ascription builtin [#6159](https://github.com/rust-lang/rustfmt/issues/6159)
48+
```rust
49+
fn main() {
50+
builtin # type_ascribe(10, usize)
51+
}
52+
```
53+
- rustfmt no longer removes inner attributes from inline const blocks [#6158](https://github.com/rust-lang/rustfmt/issues/6158)
54+
```rust
55+
fn main() {
56+
const {
57+
#![allow(clippy::assertions_on_constants)]
58+
59+
assert!(1 < 2);
60+
}
61+
}
62+
```
63+
- rustfmt no longer removes `safe` and `unsafe` keywords from static items in extern blocks.
64+
This helps support [`#![feature(unsafe_extern_blocks)]`](https://github.com/rust-lang/rust/issues/123743) [#6204](https://github.com/rust-lang/rustfmt/pull/6204)
65+
```rust
66+
#![feature(unsafe_extern_blocks)]
67+
68+
unsafe extern "C" {
69+
safe static TEST1: i32;
70+
unsafe static TEST2: i32;
71+
}
72+
```
73+
74+
75+
### Changed
76+
77+
- `hide_parse_errors` has been soft deprecated and it's been renamed to `show_parse_errors` [#5961](https://github.com/rust-lang/rustfmt/pull/5961).
78+
- The diff output produced by `rustfmt --check` is more compatable with editors that support navigating directly to line numbers [#5971](https://github.com/rust-lang/rustfmt/pull/5971)
79+
- When using `version=Two`, the `trace!` macro from the [log crate] is now formatted similarly to `debug!`, `info!`, `warn!`, and `error!` [#5987](https://github.com/rust-lang/rustfmt/issues/5987).
80+
81+
[log crate]: https://crates.io/crates/log
82+
83+
84+
### Added
85+
86+
- `generated_marker_line_search_limit` is a new unstable configuration option that allows users to configure how many lines to search for an `@generated` marker when `format_generated_files=false` [#5658](https://github.com/rust-lang/rustfmt/issues/5658)
87+
88+
89+
### Misc
90+
591
- Updating `dirs 4.0.0 -> 5.0.1` and `cargo_metadata 0.15.4 -> 0.18.0` [#6033] (https://github.com/rust-lang/rustfmt/issues/6033)
92+
- For reference, here's the [dirs v5 changelog](https://github.com/dirs-dev/dirs-rs/blob/main/README.md#5)
93+
- Updated [itertools v0.11 -> v0.12](https://github.com/rust-itertools/itertools/blob/v0.12.1/CHANGELOG.md#0120) [#6093](https://github.com/rust-lang/rustfmt/pull/6093)
94+
- Addressed clap deprecations output when running `cargo check --features clap/deprecated` [#6101](https://github.com/rust-lang/rustfmt/pull/6101)
95+
- Bumped bytecount `0.6.4` -> `0.6.8` to fix compilation issues with the `generic-simd` feature. See [bytecount#92] and [bytecount#93]
96+
97+
[bytecount#92]: https://github.com/llogiq/bytecount/pull/92
98+
[bytecount#93]: https://github.com/llogiq/bytecount/pull/93
99+
- Replace the `lazy_static` dependency with `std::sync::OnceLock` [#6154](https://github.com/rust-lang/rustfmt/pull/6154)
6100

7101
## [1.7.0] 2023-10-22
8102

@@ -146,7 +240,7 @@
146240

147241
### Added
148242

149-
- 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)
243+
- 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)
150244

151245
### Misc
152246

Cargo.lock

Lines changed: 3 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

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

33
name = "rustfmt-nightly"
4-
version = "1.7.0"
4+
version = "1.7.1"
55
description = "Tool to find and fix Rust formatting issues"
66
repository = "https://github.com/rust-lang/rustfmt"
77
readme = "README.md"
@@ -35,7 +35,7 @@ generic-simd = ["bytecount/generic-simd"]
3535
[dependencies]
3636
annotate-snippets = { version = "0.9", features = ["color"] }
3737
anyhow = "1.0"
38-
bytecount = "0.6.4"
38+
bytecount = "0.6.8"
3939
cargo_metadata = "0.18"
4040
clap = { version = "4.4.2", features = ["derive"] }
4141
clap-cargo = "0.12.0"
@@ -44,14 +44,13 @@ dirs = "5.0"
4444
getopts = "0.2"
4545
ignore = "0.4"
4646
itertools = "0.12"
47-
lazy_static = "1.4"
4847
regex = "1.7"
4948
serde = { version = "1.0.160", features = ["derive"] }
5049
serde_json = "1.0"
5150
term = "0.7"
5251
thiserror = "1.0.40"
5352
toml = "0.7.4"
54-
tracing = "0.1.37"
53+
tracing = { version = "0.1.37", default-features = false, features = ["std"] }
5554
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
5655
unicode-segmentation = "1.9"
5756
unicode-width = "0.1"

0 commit comments

Comments
 (0)