From 1db47e947d3637f78b3159b3fca4835f6d08706f Mon Sep 17 00:00:00 2001 From: Alessio Raviola Date: Tue, 8 Oct 2024 11:27:17 +0200 Subject: [PATCH] Hint which style_edition to use instead of version Update docs --- Configurations.md | 6 ++++-- src/config/config_type.rs | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Configurations.md b/Configurations.md index b1f54060392..9e1e8b09583 100644 --- a/Configurations.md +++ b/Configurations.md @@ -2369,7 +2369,7 @@ specific version of rustfmt is used in your CI, use this option. The width threshold for an array element to be considered "short". -The layout of an array is dependent on the length of each of its elements. +The layout of an array is dependent on the length of each of its elements. If the length of every element in an array is below this threshold (all elements are "short") then the array can be formatted in the mixed/compressed style, but if any one element has a length that exceeds this threshold then the array elements will have to be formatted vertically. - **Default value**: `10` @@ -3062,7 +3062,9 @@ fn main() { ## `version` -This option is deprecated and has been replaced by [`style_edition`](#style_edition) +This option is deprecated and has been replaced by [`style_edition`](#style_edition). +`version = "One"` is equivalent to `style_edition = "(2015|2018|2021)"` and +`version = "Two"` is equivalent to `style_edition = "2024"` - **Default value**: `One` - **Possible values**: `One`, `Two` diff --git a/src/config/config_type.rs b/src/config/config_type.rs index 14217caba0a..afac8d3fcf9 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -571,7 +571,11 @@ macro_rules! create_config { eprintln!( "Warning: the `version` option is deprecated. \ - Use `style_edition` instead." + Use `style_edition=\"{0}\"` instead.", + match self.version.2 { + Version::One => "2015", + Version::Two => "2024", + } ); if self.was_set().style_edition() || self.was_set_cli().style_edition() {