Introduce required language_edition and style_edition inputs for Diff Check#6742
Closed
jieyouxu wants to merge 3 commits intorust-lang:mainfrom
Closed
Introduce required language_edition and style_edition inputs for Diff Check#6742jieyouxu wants to merge 3 commits intorust-lang:mainfrom
language_edition and style_edition inputs for Diff Check#6742jieyouxu wants to merge 3 commits intorust-lang:mainfrom
Conversation
ytmimi
approved these changes
Dec 8, 2025
Contributor
|
Just want to note that rustfmt defaults to using |
Member
Author
|
Hm, good point. I'll also make that explicit. |
f04c92f to
b2b5306
Compare
style_edition input for Diff Checklanguage_edition and style_edition inputs for Diff Check
Member
Author
|
Updated the PR to also make language edition explicit. Also rebased since #6741 merged. |
No functional changes. Just was bothering me :D
So that when manually dispatching the Diff Check workflow, an explicit style edition is specified. Note that the style edition specified with `style_edition` input can still be overridden by `rustfmt_configs`, but the intention is to make sure the `style_edition` is always specified.
b2b5306 to
de4e3e7
Compare
fee1-dead
approved these changes
Dec 19, 2025
Member
fee1-dead
left a comment
There was a problem hiding this comment.
had a small nit, otherwise i think good to merge
When a language edition is not specified, `rustfmt` will default to Edition 2015 (like `rustc`), which tends to cause parse errors in the preset set of candidate projects being used for comparison. Introduce a required `language_edition` input for the Diff Check workflow (and the `check_diff.sh` script) so that the contributor invoking the workflow is much less likely to miss specifying the language edition. Like the previous `style_edition` input, the language edition can also be overriden by `edition=...` settings in the later optional `rustfmt_configs` input for consistency.
de4e3e7 to
8c0ebb8
Compare
Member
Author
|
Fixed comment, no other changes. |
Member
Author
|
(Superseded by #6770) |
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.
So that when manually dispatching the Diff Check workflow, an explicit pair of {language edition, style edition} are specified.
rustfmtwill default to Edition 2015 likerustc, which can cause a lot of parse errors in the current set of candidate projects used for comparingrustfmtbehaviors since they tend to be on Edition 2024.rustfmtcan pick a lower default style edition than the actual language edition, which can also lead to unexpected diff check outcomes.Note that the language/style editions specified with
language_edition/style_editioninputs can still be overridden byrustfmt_configs, but the intention is to make sure thelanguage_edition/style_editionare always specified.Context: #6681 (comment)
Separate
--edition/--style-editionvs--config=edition=...,style_edition=...See discussion in #t-rustfmt > style edition flag vs config.
In this PR I use the
--config=style_edition=$STYLE_EDITIONform, because I'm not actually sure what's the precedence order of mixed invocations (example below), so I just used--config=style_edition=$STYLE_EDITIONwhere laterstyle_editionsspecified in optionalrustfmt_configsshould take precedence over this input.Review remarks
The first commit in this PR is a drive-by fix for
rusfmt->rustfmtthat was bothering me, should not contain any functional changes.The following commits are the actual script/workflow changes.