Skip to content

Commit 9567198

Browse files
Merge branch 'master' of github.com:rust-lang/rustfmt into feat/rust-lang#6063/use-semver-to-check-required-version
2 parents 9c4682a + a2625bf commit 9567198

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Configurations.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3105,9 +3105,9 @@ fn main() {
31053105

31063106
## `version`
31073107

3108-
Which version of the formatting rules to use. `Version::One` is backwards-compatible
3109-
with Rustfmt 1.0. Other versions are only backwards compatible within a major
3110-
version number.
3108+
This option is deprecated and has been replaced by [`style_edition`](#style_edition).
3109+
`version = "One"` is equivalent to `style_edition = "(2015|2018|2021)"` and
3110+
`version = "Two"` is equivalent to `style_edition = "2024"`
31113111

31123112
- **Default value**: `One`
31133113
- **Possible values**: `One`, `Two`

src/config/config_type.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,11 @@ macro_rules! create_config {
571571

572572
eprintln!(
573573
"Warning: the `version` option is deprecated. \
574-
Use `style_edition` instead."
574+
Use `style_edition=\"{0}\"` instead.",
575+
match self.version.2 {
576+
Version::One => "2015",
577+
Version::Two => "2024",
578+
}
575579
);
576580

577581
if self.was_set().style_edition() || self.was_set_cli().style_edition() {

0 commit comments

Comments
 (0)