From cf352a766fc6c796e33acca5261d1be6a3955bbb Mon Sep 17 00:00:00 2001 From: Caleb Cartwright Date: Sun, 28 Jul 2024 18:58:38 -0500 Subject: [PATCH] chore: apply review suggestions --- Configurations.md | 2 +- src/config/config_type.rs | 4 ++-- src/overflow.rs | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Configurations.md b/Configurations.md index ec95c82fdb1..b1f54060392 100644 --- a/Configurations.md +++ b/Configurations.md @@ -2698,7 +2698,7 @@ Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338] - **Default value**: `"2015"` - **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant) -- **Stable**: Yes +- **Stable**: No [Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/ [RFC 3338]: https://rust-lang.github.io/rfcs/3338-style-evolution.html diff --git a/src/config/config_type.rs b/src/config/config_type.rs index 43f014764c9..91efb71744b 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -581,8 +581,8 @@ macro_rules! create_config { if self.was_set().style_edition() || self.was_set_cli().style_edition() { eprintln!( "Warning: the deprecated `version` option was \ - used in conjunction with the `edition` or \ - `style_edition` options which take precedence. \ + used in conjunction with the `style_edition` \ + option which takes precedence. \ The value of the `version` option will be ignored." ); } else if matches!(self.version(), Version::Two) { diff --git a/src/overflow.rs b/src/overflow.rs index 368a8aaec75..510ad3c642e 100644 --- a/src/overflow.rs +++ b/src/overflow.rs @@ -200,8 +200,12 @@ impl<'a> OverflowableItem<'a> { OverflowableItem::NestedMetaItem(..) => SPECIAL_CASE_ATTR, _ => &[], }; - let additional_cases = match (self, config.style_edition()) { - (OverflowableItem::MacroArg(..), StyleEdition::Edition2024) => SPECIAL_CASE_MACROS_V2, + let additional_cases = match self { + OverflowableItem::MacroArg(..) + if config.style_edition() >= StyleEdition::Edition2024 => + { + SPECIAL_CASE_MACROS_V2 + } _ => &[], }; base_cases.iter().chain(additional_cases)