041f113159
Fixes 5912 When `control_brace_style = "AlwaysNextLine"`, the code seems to always assume that `body_prefix` is `{`. This is however not the case when `match_arm_blocks = false`. This causes `block_sep` to introduce extra white space that causes the error. The fix was to check if `body_prefix` is empty before matching on `ControlBraceStyle::AlwaysNextLine`.
16 lines
363 B
Rust
16 lines
363 B
Rust
// rustfmt-match_arm_blocks: false
|
|
// rustfmt-control_brace_style: AlwaysNextLine
|
|
|
|
fn foo() {
|
|
match 0
|
|
{
|
|
0 =>
|
|
aaaaaaaaaaaaaaaaaaaaaaaa
|
|
+ bbbbbbbbbbbbbbbbbbbbbbbbb
|
|
+ bbbbbbbbbbbbbbbbbbbbbbbbb
|
|
+ bbbbbbbbbbbbbbbbbbbbbbbbb
|
|
+ bbbbbbbbbbbbbbbbbbbbbbbbb,
|
|
_ => 2,
|
|
}
|
|
}
|