about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-12-30 17:06:44 +0000
committerMichael Goulet <michael@errs.io>2024-12-31 00:50:21 +0000
commitf694db1e28adbff573c9430d9f6e7d129dc1c5ea (patch)
tree732bd0c5da63a6461b632152530bf12d1ab9aece
parentf95c9967506712bdf8e86b08d8b17accbde2d985 (diff)
downloadrust-f694db1e28adbff573c9430d9f6e7d129dc1c5ea.tar.gz
rust-f694db1e28adbff573c9430d9f6e7d129dc1c5ea.zip
Stabilize style_edition 2024 in-tree
-rw-r--r--src/tools/rustfmt/src/bin/main.rs11
-rw-r--r--src/tools/rustfmt/src/config/mod.rs4
-rw-r--r--src/tools/rustfmt/src/config/options.rs1
3 files changed, 6 insertions, 10 deletions
diff --git a/src/tools/rustfmt/src/bin/main.rs b/src/tools/rustfmt/src/bin/main.rs
index c7d3a060d54..4078484ff10 100644
--- a/src/tools/rustfmt/src/bin/main.rs
+++ b/src/tools/rustfmt/src/bin/main.rs
@@ -568,10 +568,6 @@ impl GetOptsOptions {
                 if let Some(ref file_lines) = matches.opt_str("file-lines") {
                     options.file_lines = file_lines.parse()?;
                 }
-                if let Some(ref edition_str) = matches.opt_str("style-edition") {
-                    options.style_edition =
-                        Some(style_edition_from_style_edition_str(edition_str)?);
-                }
             } else {
                 let mut unstable_options = vec![];
                 if matches.opt_present("skip-children") {
@@ -583,9 +579,6 @@ impl GetOptsOptions {
                 if matches.opt_present("file-lines") {
                     unstable_options.push("`--file-lines`");
                 }
-                if matches.opt_present("style-edition") {
-                    unstable_options.push("`--style-edition`");
-                }
                 if !unstable_options.is_empty() {
                     let s = if unstable_options.len() == 1 { "" } else { "s" };
                     return Err(format_err!(
@@ -661,6 +654,10 @@ impl GetOptsOptions {
             }
         }
 
+        if let Some(ref edition_str) = matches.opt_str("style-edition") {
+            options.style_edition = Some(style_edition_from_style_edition_str(edition_str)?);
+        }
+
         Ok(options)
     }
 
diff --git a/src/tools/rustfmt/src/config/mod.rs b/src/tools/rustfmt/src/config/mod.rs
index ea257c0a8ba..7355adc9f9d 100644
--- a/src/tools/rustfmt/src/config/mod.rs
+++ b/src/tools/rustfmt/src/config/mod.rs
@@ -29,7 +29,7 @@ pub(crate) mod style_edition;
 // This macro defines configuration options used in rustfmt. Each option
 // is defined as follows:
 //
-// `name: value type, default value, is stable, description;`
+// `name: value type, is stable, description;`
 create_config! {
     // Fundamental stuff
     max_width: MaxWidth, true, "Maximum width of each line";
@@ -149,7 +149,7 @@ create_config! {
     blank_lines_lower_bound: BlankLinesLowerBound, false,
         "Minimum number of blank lines which must be put between items";
     edition: EditionConfig, true, "The edition of the parser (RFC 2052)";
-    style_edition: StyleEditionConfig, false, "The edition of the Style Guide (RFC 3338)";
+    style_edition: StyleEditionConfig, true, "The edition of the Style Guide (RFC 3338)";
     version: VersionConfig, false, "Version of formatting rules";
     inline_attribute_width: InlineAttributeWidth, false,
         "Write an item and its attribute on the same line \
diff --git a/src/tools/rustfmt/src/config/options.rs b/src/tools/rustfmt/src/config/options.rs
index c526b5c678f..bbc99a2dced 100644
--- a/src/tools/rustfmt/src/config/options.rs
+++ b/src/tools/rustfmt/src/config/options.rs
@@ -511,7 +511,6 @@ pub enum StyleEdition {
     Edition2021,
     #[value = "2024"]
     #[doc_hint = "2024"]
-    #[unstable_variant]
     /// [Edition 2024]().
     Edition2024,
 }