Skip to content

Commit 9df11a5

Browse files
committed
Merge commit 'e47f161c8476418e8b55b61db3bbf0338e0ab827' into rustfmt-subtree-update
2 parents 88638df + e47f161 commit 9df11a5

76 files changed

Lines changed: 1557 additions & 306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- [ ] I did not use an LLM to create a change in this PR.
2+
- [ ] I used an LLM to create a change in this PR, and I have explained below how it was used.
3+
4+
<!--
5+
Please read our [LLM policy] before opening a PR,
6+
and check one of the boxes above to indicate whether you've used an LLM.
7+
If you do not check a box, a reviewer may ask you whether an LLM was involved.
8+
LLM contributions are not banned, but are held to a higher standard of review and correctness.
9+
10+
[LLM policy]: https://forge.rust-lang.org/policies/llm-usage.html
11+
-->

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

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

5555
- name: Build check_diff binary
5656
working-directory: ./check_diff
57-
run: cargo build --release
57+
run: cargo build --release --locked
5858

5959
- name: Run Diff Check
6060
working-directory: ./check_diff
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: clippy
2+
on:
3+
merge_group:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
check_clippy_configs:
11+
runs-on: ubuntu-latest
12+
name: check clippy configs
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: install rustup
17+
run: |
18+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
19+
sh rustup-init.sh -y --default-toolchain none
20+
- name: Check clippy configs all match
21+
run: cargo run --locked --manifest-path ci/Cargo.toml -- clippy-config-check
22+
23+
24+
run_clippy:
25+
runs-on: ubuntu-latest
26+
name: clippy ${{ matrix.package }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
package:
31+
- . # rustfmt
32+
- check_diff
33+
- ci
34+
- config_proc_macro
35+
steps:
36+
- name: checkout
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
- name: install rustup
39+
run: |
40+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
41+
sh rustup-init.sh -y --default-toolchain none
42+
- name: clippy
43+
run: cargo clippy --locked --manifest-path ${{ matrix.package }}/Cargo.toml
44+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ jobs:
7070
- name: run integration tests
7171
env:
7272
TARGET: x86_64-unknown-linux-gnu
73-
run: cargo run --manifest-path ci/Cargo.toml integration ${{ matrix.integration }}
73+
run: cargo run --locked --manifest-path ci/Cargo.toml integration ${{ matrix.integration }}
7474
continue-on-error: ${{ matrix.allow-failure == true }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
- name: document rustfmt
2424
env:
2525
RUSTDOCFLAGS: --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options -Dwarnings
26-
run: cargo doc -Zskip-rustdoc-fingerprint --no-deps -p rustfmt-nightly -p rustfmt-config_proc_macro
26+
run: cargo doc --locked -Zskip-rustdoc-fingerprint --no-deps -p rustfmt-nightly -p rustfmt-config_proc_macro

‎src/tools/rustfmt/.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
env:
7979
RUSTFLAGS: -D warnings
8080
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT: true
81-
run: cargo run --manifest-path ci/Cargo.toml build-and-test
81+
run: cargo run --locked --manifest-path ci/Cargo.toml build-and-test
8282

8383
test-conclusion:
8484
name: "test conclusion"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
shell: bash
4747

4848
- name: Build release binaries
49-
run: cargo build --release
49+
run: cargo build --release --locked
5050

5151
- name: Build archive
5252
shell: bash

‎src/tools/rustfmt/CHANGELOG.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,51 @@
33
## [Unreleased]
44

55

6+
<!-- These changes will be available on the stable released channel alongside Rust 1.100 -->
7+
## [1.11.0] 2026-11-12
8+
9+
### Fixed
10+
- Preserve attributes on `fn` type parameters [#6590](https://github.com/rust-lang/rustfmt/pull/6590).
11+
- Preserve inner attributes from `loop`, `for` and `while` expressions [#6010](https://github.com/rust-lang/rustfmt/pull/6010).
12+
- Fixed ICE when formatting inner attributes of a loop body defined inside a closure [#6978](https://github.com/rust-lang/rustfmt/pull/6978).
13+
- Fixed ICE when whitespace separated `macro_rules` and `!` [#6990](https://github.com/rust-lang/rustfmt/pull/6990).
14+
- Correct `#[cfg]` struct field pattern indentation when using `style_edition=2027` [#6983](https://github.com/rust-lang/rustfmt/pull/6983).
15+
- rustfmt now wraps a braceless closure that ends with an open range in parentheses if it's followed by a field access. For example, `|| 1.. .field` is formatted as `(|| 1..).field` [#7013](https://github.com/rust-lang/rustfmt/pull/7013).
16+
- Handle `cargo fmt --manifest-path` correctly when specifying the workspace's root `Cargo.toml` [#6524](https://github.com/rust-lang/rustfmt/pull/6524).
17+
- Prevent comment duplication between attributes and struct field patterns [#7004](https://github.com/rust-lang/rustfmt/pull/7004).
18+
- Fix char boundary panics when reporting formatting errors [#7029](https://github.com/rust-lang/rustfmt/pull/7029).
19+
- Correct comment wrapping at or before `comment_width` when using `wrap_comments=true` [#6802](https://github.com/rust-lang/rustfmt/pull/6802).
20+
- Adjust opening brace placement when setting `style_edition=2027` to better align with the style guide for multi-line control flow expressions [#7005](https://github.com/rust-lang/rustfmt/pull/7005).
21+
- Remove repeated `--style-edition` CLI help text [#7050](https://github.com/rust-lang/rustfmt/pull/7050).
22+
- Fix ICE when `for await` had extra whitespace between `for` and `await` [#7063](https://github.com/rust-lang/rustfmt/pull/7063).
23+
- Use the correct span when rewriting `ast::TyKind::FnPtr` to prevent comment recovery code from copying `cfg_attr` content into `fn` type [#7066](https://github.com/rust-lang/rustfmt/pull/7066).
24+
- Prevent infinite loops when parsing items from `cfg_select!` arms [#7089](https://github.com/rust-lang/rustfmt/pull/7089).
25+
- Correct visibility and defaultness order on associated impl type alias [#7064](https://github.com/rust-lang/rustfmt/pull/7064).
26+
- Correctly calculate the `shape` for inline const blocks when using `style_edition=2027` [#7065](https://github.com/rust-lang/rustfmt/pull/7065).
27+
- Prevent invalid code generation in macros that use raw identifiers [#7110](https://github.com/rust-lang/rustfmt/pull/7110).
28+
- Prevent rustfmt from reporting on `max_width` configuration issues when formatting macros [#6651](https://github.com/rust-lang/rustfmt/pull/6651).
29+
30+
### Changed
31+
- No longer apply `use_field_init_shorthand` when formatting macros [#6981](https://github.com/rust-lang/rustfmt/pull/6981).
32+
- Include trailing commas when rewriting single parameter `fn` declaration when setting `style_edition=2027` and `fn_params_layout="Vertical"` [#6890](https://github.com/rust-lang/rustfmt/pull/6890).
33+
- The rustfmt CLI now prevents users from setting `--check` and `--config=emit_mode` as well as `--config=emit_mode` and `--emit` [#7002](https://github.com/rust-lang/rustfmt/pull/7002).
34+
> [!IMPORTANT]
35+
> Potential breaking changes.
36+
> - Formatting doc comments within macros is now more consistent across doc-comment styles. For example, `///` vs `#[doc]`. Users may notice indentation changes `[#7042](https://github.com/rust-lang/rustfmt/pull/7042).
37+
> - Block doc-comment closer formatting change to prevent an idempotence issue. This might impact users who use block doc-comments [#7017](https://github.com/rust-lang/rustfmt/pull/7017).
38+
> - Correct binary operator expression indentation when using `hard_tabs=true`. Binary expression formatting might change if you're using `hard_tabs=true` [#6883](https://github.com/rust-lang/rustfmt/pull/6883).
39+
40+
### Added
41+
- Support formatting for `#![feature(generic_const_items)]` [#6956](https://github.com/rust-lang/rustfmt/pull/6956).
42+
- Format `cfg_select!` macros on the nightly release channel [rust-lang/rust#154202](https://github.com/rust-lang/rust/pull/154202) [rust-lang/rust#160998](https://github.com/rust-lang/rust/pull/160998).
43+
44+
### Misc
45+
- Bump `annotate-snippets` to 0.12 [#6947](https://github.com/rust-lang/rustfmt/pull/6947).
46+
- Bump `toml` to 1.1 [#7008](https://github.com/rust-lang/rustfmt/pull/7008).
47+
- Bump `tracing-subscriber` to 0.3.20 [#6760](https://github.com/rust-lang/rustfmt/pull/6760) [#6772](https://github.com/rust-lang/rustfmt/pull/6772).
48+
- Add clippy linting to all rustfmt packages [#7116](https://github.com/rust-lang/rustfmt/pull/7116) [#7124](https://github.com/rust-lang/rustfmt/pull/7124).
49+
50+
651
## [1.10.0] 2026-07-21
752

853
### Fixed

‎src/tools/rustfmt/Cargo.lock‎

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ dependencies = [
1111
"memchr",
1212
]
1313

14+
[[package]]
15+
name = "aho-corasick"
16+
version = "1.1.5"
17+
source = "registry+https://github.com/rust-lang/crates.io-index"
18+
checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
19+
dependencies = [
20+
"memchr",
21+
]
22+
1423
[[package]]
1524
name = "annotate-snippets"
1625
version = "0.12.16"
@@ -320,7 +329,7 @@ version = "0.4.8"
320329
source = "registry+https://github.com/rust-lang/crates.io-index"
321330
checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd"
322331
dependencies = [
323-
"aho-corasick",
332+
"aho-corasick 0.7.18",
324333
"bstr",
325334
"fnv",
326335
"log",
@@ -432,18 +441,15 @@ checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
432441

433442
[[package]]
434443
name = "log"
435-
version = "0.4.16"
444+
version = "0.4.34"
436445
source = "registry+https://github.com/rust-lang/crates.io-index"
437-
checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8"
438-
dependencies = [
439-
"cfg-if",
440-
]
446+
checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
441447

442448
[[package]]
443449
name = "matchers"
444-
version = "0.1.0"
450+
version = "0.2.0"
445451
source = "registry+https://github.com/rust-lang/crates.io-index"
446-
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
452+
checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
447453
dependencies = [
448454
"regex-automata",
449455
]
@@ -456,12 +462,11 @@ checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4"
456462

457463
[[package]]
458464
name = "nu-ansi-term"
459-
version = "0.46.0"
465+
version = "0.50.3"
460466
source = "registry+https://github.com/rust-lang/crates.io-index"
461-
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
467+
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
462468
dependencies = [
463-
"overload",
464-
"winapi",
469+
"windows-sys",
465470
]
466471

467472
[[package]]
@@ -482,12 +487,6 @@ version = "0.2.0"
482487
source = "registry+https://github.com/rust-lang/crates.io-index"
483488
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
484489

485-
[[package]]
486-
name = "overload"
487-
version = "0.1.1"
488-
source = "registry+https://github.com/rust-lang/crates.io-index"
489-
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
490-
491490
[[package]]
492491
name = "pin-project-lite"
493492
version = "0.2.9"
@@ -535,18 +534,20 @@ version = "1.7.3"
535534
source = "registry+https://github.com/rust-lang/crates.io-index"
536535
checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
537536
dependencies = [
538-
"aho-corasick",
537+
"aho-corasick 0.7.18",
539538
"memchr",
540-
"regex-syntax",
539+
"regex-syntax 0.6.29",
541540
]
542541

543542
[[package]]
544543
name = "regex-automata"
545-
version = "0.1.10"
544+
version = "0.4.18"
546545
source = "registry+https://github.com/rust-lang/crates.io-index"
547-
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
546+
checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
548547
dependencies = [
549-
"regex-syntax",
548+
"aho-corasick 1.1.5",
549+
"memchr",
550+
"regex-syntax 0.8.11",
550551
]
551552

552553
[[package]]
@@ -555,6 +556,12 @@ version = "0.6.29"
555556
source = "registry+https://github.com/rust-lang/crates.io-index"
556557
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
557558

559+
[[package]]
560+
name = "regex-syntax"
561+
version = "0.8.11"
562+
source = "registry+https://github.com/rust-lang/crates.io-index"
563+
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
564+
558565
[[package]]
559566
name = "rustfmt-config_proc_macro"
560567
version = "0.3.0"
@@ -566,7 +573,7 @@ dependencies = [
566573

567574
[[package]]
568575
name = "rustfmt-nightly"
569-
version = "1.10.0"
576+
version = "1.11.0"
570577
dependencies = [
571578
"annotate-snippets",
572579
"anyhow",
@@ -839,46 +846,45 @@ checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
839846

840847
[[package]]
841848
name = "tracing"
842-
version = "0.1.37"
849+
version = "0.1.44"
843850
source = "registry+https://github.com/rust-lang/crates.io-index"
844-
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
851+
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
845852
dependencies = [
846-
"cfg-if",
847853
"pin-project-lite",
848854
"tracing-core",
849855
]
850856

851857
[[package]]
852858
name = "tracing-core"
853-
version = "0.1.31"
859+
version = "0.1.36"
854860
source = "registry+https://github.com/rust-lang/crates.io-index"
855-
checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
861+
checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
856862
dependencies = [
857863
"once_cell",
858864
"valuable",
859865
]
860866

861867
[[package]]
862868
name = "tracing-log"
863-
version = "0.1.3"
869+
version = "0.2.0"
864870
source = "registry+https://github.com/rust-lang/crates.io-index"
865-
checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
871+
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
866872
dependencies = [
867-
"lazy_static",
868873
"log",
874+
"once_cell",
869875
"tracing-core",
870876
]
871877

872878
[[package]]
873879
name = "tracing-subscriber"
874-
version = "0.3.17"
880+
version = "0.3.20"
875881
source = "registry+https://github.com/rust-lang/crates.io-index"
876-
checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77"
882+
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
877883
dependencies = [
878884
"matchers",
879885
"nu-ansi-term",
880886
"once_cell",
881-
"regex",
887+
"regex-automata",
882888
"sharded-slab",
883889
"smallvec",
884890
"thread_local",

‎src/tools/rustfmt/Cargo.toml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustfmt-nightly"
3-
version = "1.10.0"
3+
version = "1.11.0"
44
description = "Tool to find and fix Rust formatting issues"
55
repository = "https://github.com/rust-lang/rustfmt"
66
license = "Apache-2.0 OR MIT"
@@ -69,3 +69,17 @@ insta = { version = "1.48.0", features = ["filters"] }
6969
[package.metadata.rust-analyzer]
7070
# This package uses #[feature(rustc_private)]
7171
rustc_private = true
72+
73+
[lints.clippy]
74+
# allow all rules with a low priority ..
75+
all = { level = "allow", priority = -1 }
76+
# so we can pick out an exact subset of rules to deny
77+
correctness = "deny"
78+
char_lit_as_u8 = "deny"
79+
four_forward_slashes = "deny"
80+
non_minimal_cfg = "deny"
81+
print_literal = "deny"
82+
same_item_push = "deny"
83+
single_char_add_str = "deny"
84+
to_string_in_format_args = "deny"
85+
unconditional_recursion = "deny"

0 commit comments

Comments
 (0)