This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Original file line number Diff line number Diff line change @@ -1346,6 +1346,7 @@ pub fn can_be_overflowed_expr(
1346
1346
ast:: ExprKind :: Match ( ..) => {
1347
1347
( context. use_block_indent ( ) && args_len == 1 )
1348
1348
|| ( context. config . indent_style ( ) == IndentStyle :: Visual && args_len > 1 )
1349
+ || context. config . overflow_delimited_expr ( )
1349
1350
}
1350
1351
ast:: ExprKind :: If ( ..)
1351
1352
| ast:: ExprKind :: IfLet ( ..)
Original file line number Diff line number Diff line change
1
+ // rustfmt-overflow_delimited_expr: true
2
+
3
+ fn main ( ) {
4
+ println ! (
5
+ "Foobar: {}" ,
6
+ match "input" {
7
+ "a" => "" ,
8
+ "b" => "" ,
9
+ "c" => "" ,
10
+ "d" => "" ,
11
+ "e" => "" ,
12
+ "f" => "" ,
13
+ "g" => "" ,
14
+ "h" => "" ,
15
+ "i" => "" ,
16
+ "j" => "" ,
17
+ "k" => "" ,
18
+ "l" => "" ,
19
+ "m" => "" ,
20
+ "n" => "" ,
21
+ "o" => "" ,
22
+ "p" => "" ,
23
+ "q" => "" ,
24
+ "r" => "Rust" ,
25
+ }
26
+ ) ;
27
+ }
28
+
29
+ fn main ( ) {
30
+ println ! (
31
+ "Very Long Input String Which Makes It Impossible To Fit On The Same Line: {}" ,
32
+ match "input" {
33
+ "a" => "" ,
34
+ "b" => "" ,
35
+ "c" => "" ,
36
+ "d" => "" ,
37
+ "e" => "" ,
38
+ "f" => "" ,
39
+ "g" => "" ,
40
+ "h" => "" ,
41
+ "i" => "" ,
42
+ "j" => "" ,
43
+ "k" => "" ,
44
+ "l" => "" ,
45
+ "m" => "" ,
46
+ "n" => "" ,
47
+ "o" => "" ,
48
+ "p" => "" ,
49
+ "q" => "" ,
50
+ "r" => "Rust" ,
51
+ }
52
+ ) ;
53
+ }
Original file line number Diff line number Diff line change
1
+ // rustfmt-overflow_delimited_expr: true
2
+
3
+ fn main ( ) {
4
+ println ! ( "Foobar: {}" , match "input" {
5
+ "a" => "" ,
6
+ "b" => "" ,
7
+ "c" => "" ,
8
+ "d" => "" ,
9
+ "e" => "" ,
10
+ "f" => "" ,
11
+ "g" => "" ,
12
+ "h" => "" ,
13
+ "i" => "" ,
14
+ "j" => "" ,
15
+ "k" => "" ,
16
+ "l" => "" ,
17
+ "m" => "" ,
18
+ "n" => "" ,
19
+ "o" => "" ,
20
+ "p" => "" ,
21
+ "q" => "" ,
22
+ "r" => "Rust" ,
23
+ } ) ;
24
+ }
25
+
26
+ fn main ( ) {
27
+ println ! (
28
+ "Very Long Input String Which Makes It Impossible To Fit On The Same Line: {}" ,
29
+ match "input" {
30
+ "a" => "" ,
31
+ "b" => "" ,
32
+ "c" => "" ,
33
+ "d" => "" ,
34
+ "e" => "" ,
35
+ "f" => "" ,
36
+ "g" => "" ,
37
+ "h" => "" ,
38
+ "i" => "" ,
39
+ "j" => "" ,
40
+ "k" => "" ,
41
+ "l" => "" ,
42
+ "m" => "" ,
43
+ "n" => "" ,
44
+ "o" => "" ,
45
+ "p" => "" ,
46
+ "q" => "" ,
47
+ "r" => "Rust" ,
48
+ }
49
+ ) ;
50
+ }
You can’t perform that action at this time.
0 commit comments