rustfmt subtree update - #161964
Open
jieyouxu wants to merge 138 commits into
Open
Conversation
When formatting a function with a single parameter with `fn_params_layout` set to `Vertical`, the previous tactic would remove any trailing commas before spilling to multiple lines for other reasons, such as long function names or return types. Instead, use the same tactic as `Tall` does, so that the trailing comma is kept if the end result spans multiple lines. `fn_params_layout = "Vertical"` is stable, so this is a breaking change. Guard on the style edition so that it only takes effect starting in the next edition. Issue rust-lang#6889 `fn_params_layout = "Vertical"` removes single argument's trailing comma
I can't markdown.
Fix subtree sync doc commit message template markup
…om outer attributes It's possible that at least one of the attributes is a custom proc macro that takes the module tokens as an input. It's hard to know for sure since rustfmt only operates on the AST pre-expansion. In this case we'll be overly permissive and just ignore the file not found error so rustfmt can still try formatting the input. Fixes rustfmt issue 6959
…chenkov rustfmt fix: allow file not found errors for external mods annotated with `#[my_macro]` Tracking issue: rust-lang#54727 `#[my_macro]` was stabilized for macro hygiene 2.0 in rust-lang#157857. There isn't a guarantee that the external module exists on the file system so ignore any file not found errors encountered when trying to resolve the module's file. Fixes rust-lang/rustfmt#6959 r? @petrochenkov cc: @TimNN
…es, r=ytmimi,jieyouxu rustfmt: Discover modules via `cfg_select!` This PR renames all occurrences of `cfg_match!` in rustfmt to `cfg_select!`. This makes the module file detection logic from rust-lang/rustfmt#6522 kick in for `cfg_select!` instead of `cfg_match!`, which no longer exists. This PR performs no other adjustments to the logic to be as small as possible. I am opening this PR in this repo since that is also the target for the more comprehensive rust-lang#154202, which covers more than merely detecting other files through `cfg_select!`. Closes rust-lang#158371. CC: @ytmimi, @CAD97
Fixes 5973 The [attribute] docs in the rust reference explain that inner attributes are allowed in block expressions. [attribute]: https://doc.rust-lang.org/reference/attributes.html
…oc-attributes-docs Fix normalize_doc_attributes configuration docs
We now have a much larger enterprise parallel job limit.
To make it easier to configure merge queue and reduce duplication.
…iling_comments_that_end_in_a_comma tests: cover trailing comments that end in a comma
…990) Co-authored-by: Yacin Tmimi <yacintmimi@gmail.com>
`cfg_select!` parsing needs to be implemented in rustfmt right now because there's no good way to call `rustc_attr_parsing::parse_cfg_select`.
The plan is to leverage `rewrite_match_body` to help with `cfg_select!` formatting.
fix: correct the span used when rewriting `ast::TyKind::FnPtr`
fix: correct visibility and defaultness order on associated impl type alias
Rollup of 5 pull requests Successful merges: - rust-lang#156749 (remove `box_patterns`) - rust-lang#161411 (avoid overlapping const suggestions) - rust-lang#161484 (Discard `.pdr` in the PSP linker script) - rust-lang#161663 (Reduce dependency on implicit paths in bootstrap) - rust-lang#161720 (rename rust_target_features query to make it clear that these are *all* target features)
add internal DSL for testing binders implements rust-lang/project-assumptions-on-binders#8 apologies to the inevitable swarm of people who get pinged for this... basically the only interesting diff is `compiler/rustc_hir_analysis/src/check/wfcheck.rs`, which actually implements the test. there's probably still features we want to add to this DSL (e.g. `RegionConstraint::AliasTyOutlivesViaEnv`), and there might be some bugs lurking, but this is at least a base to work off of. It's perma-unstable and for internal use only, so support and quality doesn't have to be incredibly high. For example, parser recovery and whatnot is just, bad, but whatever. r? BoxyUwU
``` warning: explicit `package.readme` can be inferred --> src/tools/rustfmt/Cargo.toml:6:1 | 6 | readme = "README.md" | ^^^^^^^^^^^^^^^^^^^^ | = note: `cargo::manual_readme` is set to `warn` by default help: consider removing `package.readme` warning: `rustfmt-nightly` (manifest) generated 1 warning ``` See <https://triage.rust-lang.org/gha-logs/rust-lang/rust/98030530980#L2026-08-26T03:05:00.5387201Z-L2026-08-26T03:05:00.5388957Z>
chore: fix lint `cargo::manual_readme`
…26-08-27 subtree-push nightly-2026-08-27
Now we can configure which release channel the compiled rustfmt should target. Because `CFG_RELEASE_CHANNEL` wasn't getting set before we'd default to the `nightly` channel. For the most part that's not really an issue, but because we're using the diff check to ensure that we're not changing stable formatting it's more appropriate to default builds to the `stable` release channel.
…_diff.yml The `release_channel` defaults to `stable`, but it might be nice in some cases to test different release channels.
…diff_check feature: Allow user's to set the release channel when running the diff check
Drop unused `Makefile.toml`
Collaborator
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged.
cc @rust-lang/rustfmt |
This comment was marked as off-topic.
This comment was marked as off-topic.
Contributor
|
@bors r+ p=1 rollup=never |
Contributor
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-pull direction for rust-lang/rustfmt#7079.
As discussed in #t-rustfmt > need a sync ASAP @ 💬, we didn't bump version / do changelog between the subtree-push and this subtree-pull yet.
Last commit I had to regenerate the main workspace lockfile.
r? @ytmimi