Skip to content

Commit f371e16

Browse files
committed
revert overflow_delimited_expr default for style edition 2024
As of the stabalization of edition 2024 (including style edition 2024) the `overflow_delimited_expr` default was reverted back to `false`. rustfmt hasn't been synced with r-l/rust in a while and not having this config is causing massive diffs in rustfmt's `Diff Check` job. To make the next subtree push easier to verify I'm manually adding this change to the rustfmt tree before the `subtree push`.
1 parent ee329d3 commit f371e16

File tree

4 files changed

+48
-38
lines changed

4 files changed

+48
-38
lines changed

src/bin/main.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,6 @@ mod test {
818818
options.inline_config = HashMap::from([("version".to_owned(), "Two".to_owned())]);
819819
let config = get_config(None, Some(options));
820820
assert_eq!(config.style_edition(), StyleEdition::Edition2024);
821-
assert_eq!(config.overflow_delimited_expr(), true);
822821
}
823822

824823
#[nightly_only_test]
@@ -828,7 +827,6 @@ mod test {
828827
let config_file = Some(Path::new("tests/config/style-edition/just-version"));
829828
let config = get_config(config_file, Some(options));
830829
assert_eq!(config.style_edition(), StyleEdition::Edition2024);
831-
assert_eq!(config.overflow_delimited_expr(), true);
832830
}
833831

834832
#[nightly_only_test]
@@ -873,7 +871,6 @@ mod test {
873871
]);
874872
let config = get_config(None, Some(options));
875873
assert_eq!(config.style_edition(), StyleEdition::Edition2024);
876-
assert_eq!(config.overflow_delimited_expr(), true);
877874
}
878875

879876
#[nightly_only_test]
@@ -939,7 +936,6 @@ mod test {
939936
options.style_edition = Some(StyleEdition::Edition2024);
940937
let config = get_config(None, Some(options));
941938
assert_eq!(config.style_edition(), StyleEdition::Edition2024);
942-
assert_eq!(config.overflow_delimited_expr(), true);
943939
}
944940

945941
#[nightly_only_test]
@@ -949,7 +945,6 @@ mod test {
949945
let config_file = Some(Path::new("tests/config/style-edition/overrides"));
950946
let config = get_config(config_file, Some(options));
951947
assert_eq!(config.style_edition(), StyleEdition::Edition2024);
952-
assert_eq!(config.overflow_delimited_expr(), false);
953948
}
954949

955950
#[nightly_only_test]
@@ -958,9 +953,9 @@ mod test {
958953
let mut options = GetOptsOptions::default();
959954
let config_file = Some(Path::new("tests/config/style-edition/just-style-edition"));
960955
options.inline_config =
961-
HashMap::from([("overflow_delimited_expr".to_owned(), "false".to_owned())]);
956+
HashMap::from([("overflow_delimited_expr".to_owned(), "true".to_owned())]);
962957
let config = get_config(config_file, Some(options));
963958
assert_eq!(config.style_edition(), StyleEdition::Edition2024);
964-
assert_eq!(config.overflow_delimited_expr(), false);
959+
assert_eq!(config.overflow_delimited_expr(), true);
965960
}
966961
}

src/config/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ binop_separator = "Front"
889889
remove_nested_parens = true
890890
combine_control_expr = true
891891
short_array_element_width_threshold = 10
892-
overflow_delimited_expr = true
892+
overflow_delimited_expr = false
893893
struct_field_align_threshold = 0
894894
enum_discrim_align_threshold = 0
895895
match_arm_blocks = true

src/config/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ config_option_with_style_edition_default!(
660660
RemoveNestedParens, bool, _ => true;
661661
CombineControlExpr, bool, _ => true;
662662
ShortArrayElementWidthThreshold, usize, _ => 10;
663-
OverflowDelimitedExpr, bool, Edition2024 => true, _ => false;
663+
OverflowDelimitedExpr, bool, _ => false;
664664
StructFieldAlignThreshold, usize, _ => 0;
665665
EnumDiscrimAlignThreshold, usize, _ => 0;
666666
MatchArmBlocks, bool, _ => true;

tests/target/configs/style_edition/overflow_delim_expr_2024.rs

+44-29
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ fn combine_blocklike() {
2525
y: value2,
2626
});
2727

28-
do_thing(x, Bar {
29-
x: value,
30-
y: value2,
31-
});
28+
do_thing(
29+
x,
30+
Bar {
31+
x: value,
32+
y: value2,
33+
},
34+
);
3235

3336
do_thing(
3437
x,
@@ -46,12 +49,15 @@ fn combine_blocklike() {
4649
value4_with_longer_name,
4750
]);
4851

49-
do_thing(x, &[
50-
value_with_longer_name,
51-
value2_with_longer_name,
52-
value3_with_longer_name,
53-
value4_with_longer_name,
54-
]);
52+
do_thing(
53+
x,
54+
&[
55+
value_with_longer_name,
56+
value2_with_longer_name,
57+
value3_with_longer_name,
58+
value4_with_longer_name,
59+
],
60+
);
5561

5662
do_thing(
5763
x,
@@ -71,12 +77,15 @@ fn combine_blocklike() {
7177
value4_with_longer_name,
7278
]);
7379

74-
do_thing(x, vec![
75-
value_with_longer_name,
76-
value2_with_longer_name,
77-
value3_with_longer_name,
78-
value4_with_longer_name,
79-
]);
80+
do_thing(
81+
x,
82+
vec![
83+
value_with_longer_name,
84+
value2_with_longer_name,
85+
value3_with_longer_name,
86+
value4_with_longer_name,
87+
],
88+
);
8089

8190
do_thing(
8291
x,
@@ -99,22 +108,28 @@ fn combine_blocklike() {
99108
}
100109

101110
fn combine_struct_sample() {
102-
let identity = verify(&ctx, VerifyLogin {
103-
type_: LoginType::Username,
104-
username: args.username.clone(),
105-
password: Some(args.password.clone()),
106-
domain: None,
107-
})?;
111+
let identity = verify(
112+
&ctx,
113+
VerifyLogin {
114+
type_: LoginType::Username,
115+
username: args.username.clone(),
116+
password: Some(args.password.clone()),
117+
domain: None,
118+
},
119+
)?;
108120
}
109121

110122
fn combine_macro_sample() {
111123
rocket::ignite()
112-
.mount("/", routes![
113-
http::auth::login,
114-
http::auth::logout,
115-
http::cors::options,
116-
http::action::dance,
117-
http::action::sleep,
118-
])
124+
.mount(
125+
"/",
126+
routes![
127+
http::auth::login,
128+
http::auth::logout,
129+
http::cors::options,
130+
http::action::dance,
131+
http::action::sleep,
132+
],
133+
)
119134
.launch();
120135
}

0 commit comments

Comments
 (0)