rustfmt subtree update - #163545
Open
jieyouxu wants to merge 25 commits into
Open
rustfmt subtree update#163545jieyouxu wants to merge 25 commits into
jieyouxu wants to merge 25 commits into
Conversation
To ensure compatibility with Josh. The old name is legacy anyway.
Rename `rust-toolchain` to `rust-toolchain.toml`
While processing children in a chain, e.g. the `1.foo.bar` in `root.1.foo.bar` there was a check that would skip handling comments (and so remove them) if the `use_try_shorthand` config option was set. This is because earlier in the processing (trace: `Chain::from_ast` -> `Chain::make_subexpr_list` -> `Chain::pop_expr_chain`) we would replace `try!(..)` expressions with `?` ones but _not_ update spans, so things would get confused later if we tried to use these spans to recover comments. However, it's not possible for a `try!` macro to appear as a child, e.g. `root.try!(bar);`, so this check is unnecessary. There are added parser failure tests to demonstrate this. Aside: Of course a: `try!` can be the _root_ of a chain `try!(foo).bar` is perfectly valid. And `?` can be used anywhere in a chain: `foo.try!(bar)` is invalid, but `foo.bar?` is valid. This change only focuses on the `try!` macros. Fixes: rust-lang/rustfmt#6121
`chain`: drop redundant check
This updates the rust-toolchain.toml file to nightly-2026-09-23 (6bb1652).
Pull recent changes from https://github.com/rust-lang/rust via Josh. Previous upstream ref: rust-lang/rust@bba5310 New upstream ref: rust-lang/rust@6bb1652 Filtered ref: rust-lang/rustfmt@6169545 Upstream diff: rust-lang/rust@bba5310...6bb1652 This merge was created using https://github.com/rust-lang/josh-sync.
Initial Josh pull
This probably was needed at some point in the rust-lang/rust tree when someone was tuning the lint itself? But in any case, we don't need this anymore.
Drop unneeded `#![allow(unreachable_pub)]`
fix(config): search for config file recursively on `--config-path`
- related issues: rust-lang#5738, rust-lang#6137, rust-lang#6318, rust-lang#6378 - instead of calling unwrap(), restore original snippet when we fail to format generics in enum - we need to propagate this rewrite failure later
- introduce format_enum that returns Rewrite - early return when it fails to format the generics in enum
fix panic on failure to format generics in enum
Copy-pasta typo.
Instead of overflows, or arguably worse, bitwise reinterpretations. They tend to give us garbage (and massive) indentations.
Route rustfmt repo backport nominations to zulip
Use saturating arithmetics for `adjust_max_width`
Collaborator
|
cc @rust-lang/rustfmt |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 98aa611 failed: CI. Failed job:
|
Member
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 30, 2026
rustfmt subtree update try-job: test-armhf-gnu
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 30, 2026
rustfmt subtree update Subtree update of `rustfmt` to rust-lang/rustfmt@677b954. Created using https://github.com/rust-lang/josh-sync. ### Relnotes worthy (1.101 cycle) https://github.com/rust-lang/rustfmt/pulls?q=is%3Apr+state%3Aclosed+merged%3A2026-09-22..2026-09-30 (excluding the v1.11.0 release prep PR): * rust-lang/rustfmt#7115 (config search behavior) * rust-lang/rustfmt#7095 (potentially breaking) * rust-lang/rustfmt#6396 * rust-lang/rustfmt#7152 (but that's a fix for beta-regression) ### Needs beta backport (targetting 1.100) I will make a beta-targetting cherry-pick with the following PR * rust-lang/rustfmt#7152 --- r? @ytmimi
Member
|
@bors yield |
Contributor
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #163566. |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 30, 2026
rustfmt subtree update Subtree update of `rustfmt` to rust-lang/rustfmt@677b954. Created using https://github.com/rust-lang/josh-sync. ### Relnotes worthy (1.101 cycle) https://github.com/rust-lang/rustfmt/pulls?q=is%3Apr+state%3Aclosed+merged%3A2026-09-22..2026-09-30 (excluding the v1.11.0 release prep PR): * rust-lang/rustfmt#7115 (config search behavior) * rust-lang/rustfmt#7095 (potentially breaking) * rust-lang/rustfmt#6396 * rust-lang/rustfmt#7152 (but that's a fix for beta-regression) ### Needs beta backport (targetting 1.100) I will make a beta-targetting cherry-pick with the following PR * rust-lang/rustfmt#7152 --- r? @ytmimi
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 42d340a failed: CI. Failed job:
|
Member
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
rustfmt subtree update Subtree update of `rustfmt` to rust-lang/rustfmt@677b954. Created using https://github.com/rust-lang/josh-sync. ### Relnotes worthy (1.101 cycle) https://github.com/rust-lang/rustfmt/pulls?q=is%3Apr+state%3Aclosed+merged%3A2026-09-22..2026-09-30 (excluding the v1.11.0 release prep PR): * rust-lang/rustfmt#7115 (config search behavior) * rust-lang/rustfmt#7095 (potentially breaking) * rust-lang/rustfmt#6396 * rust-lang/rustfmt#7152 (but that's a fix for beta-regression) ### Needs beta backport (targetting 1.100) I will make a beta-targetting cherry-pick with the following PR * rust-lang/rustfmt#7152 --- r? @ytmimi
Contributor
|
💔 Test for 3c10961 failed: CI. Failed job:
|
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
[beta] rustfmt backport Cherry-pick of commits from rust-lang/rustfmt#7152 to address rust-lang/rustfmt#7147. The commits are cherry-picked from the subtree push #163545. Approved in [#t-rustfmt/backports > rustfmt#7152: beta-nominated](https://rust-lang.zulipchat.com/#narrow/channel/621384-t-rustfmt.2Fbackports/topic/rustfmt.237152.3A.20beta-nominated/with/627991509). I suppose this can be rolled up into a combined beta backport too. Anyway. r? @ytmimi
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subtree update of
rustfmtto rust-lang/rustfmt@677b954.Created using https://github.com/rust-lang/josh-sync.
Relnotes worthy (1.101 cycle)
https://github.com/rust-lang/rustfmt/pulls?q=is%3Apr+state%3Aclosed+merged%3A2026-09-22..2026-09-30 (excluding the v1.11.0 release prep PR):
--config-pathrustfmt#7115 (config search behavior)chain: drop redundant check rustfmt#7095 (potentially breaking)adjust_max_widthrustfmt#7152 (but that's a fix for beta-regression)Needs beta backport (targetting 1.100)
I will make a beta-targetting cherry-pick with the following PR
adjust_max_widthrustfmt#7152r? @ytmimi