File tree Expand file tree Collapse file tree 6 files changed +57
-57
lines changed
rustc_ast_pretty/src/pprust/state Expand file tree Collapse file tree 6 files changed +57
-57
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl<'a> State<'a> {
21
21
match & _else. kind {
22
22
// Another `else if` block.
23
23
ast:: ExprKind :: If ( i, then, e) => {
24
- self . cbox ( INDENT_UNIT - 1 ) ;
24
+ self . cbox ( INDENT_UNIT ) ;
25
25
self . ibox ( 0 ) ;
26
26
self . word ( " else if " ) ;
27
27
self . print_expr_as_cond ( i) ;
@@ -31,7 +31,7 @@ impl<'a> State<'a> {
31
31
}
32
32
// Final `else` block.
33
33
ast:: ExprKind :: Block ( b, _) => {
34
- self . cbox ( INDENT_UNIT - 1 ) ;
34
+ self . cbox ( INDENT_UNIT ) ;
35
35
self . ibox ( 0 ) ;
36
36
self . word ( " else " ) ;
37
37
self . print_block ( b)
Original file line number Diff line number Diff line change @@ -1065,7 +1065,7 @@ impl<'a> State<'a> {
1065
1065
match els_inner. kind {
1066
1066
// Another `else if` block.
1067
1067
hir:: ExprKind :: If ( i, then, e) => {
1068
- self . cbox ( INDENT_UNIT - 1 ) ;
1068
+ self . cbox ( INDENT_UNIT ) ;
1069
1069
self . ibox ( 0 ) ;
1070
1070
self . word ( " else if " ) ;
1071
1071
self . print_expr_as_cond ( i) ;
@@ -1075,7 +1075,7 @@ impl<'a> State<'a> {
1075
1075
}
1076
1076
// Final `else` block.
1077
1077
hir:: ExprKind :: Block ( b, _) => {
1078
- self . cbox ( INDENT_UNIT - 1 ) ;
1078
+ self . cbox ( INDENT_UNIT ) ;
1079
1079
self . ibox ( 0 ) ;
1080
1080
self . word ( " else " ) ;
1081
1081
self . print_block ( b) ;
Original file line number Diff line number Diff line change 16
16
{
17
17
a = 1;
18
18
} else if x < 2
19
- {
20
- a = 2;
21
- } else if x < 3
22
- {
23
- a = 3;
24
- } else if x < 4 { a = 4; } else { a = 5; }
19
+ {
20
+ a = 2;
21
+ } else if x < 3
22
+ {
23
+ a = 3;
24
+ } else if x < 4 { a = 4; } else { a = 5; }
25
25
26
- if x < y
27
- {
28
- a += 1;
29
- a += 1;
30
- a += 1;
31
- a += 1;
32
- a += 1;
33
- a += 1;
34
- } else { a += 1; a += 1; a += 1; a += 1; a += 1; a += 1; }
26
+ if x < y
27
+ {
28
+ a += 1;
29
+ a += 1;
30
+ a += 1;
31
+ a += 1;
32
+ a += 1;
33
+ a += 1;
34
+ } else { a += 1; a += 1; a += 1; a += 1; a += 1; a += 1; }
35
35
36
- if x < 1
37
- {
38
- if x < 2
39
- {
40
- if x < 3
41
- {
42
- a += 1;
43
- } else if x < 4
44
- { a += 1; if x < 5 { a += 1; } }
45
- } else if x < 6 { a += 1; } }
46
- }
36
+ if x < 1
37
+ {
38
+ if x < 2
39
+ {
40
+ if x < 3
41
+ {
42
+ a += 1;
43
+ } else if x < 4
44
+ { a += 1; if x < 5 { a += 1; } }
45
+ } else if x < 6 { a += 1; } }
46
+ }
47
47
48
- fn main() { f(3, 4); }
48
+ fn main() { f(3, 4); }
Original file line number Diff line number Diff line change 15
15
if x < 1 {
16
16
a = 1;
17
17
} else if x < 2 {
18
- a = 2;
19
- } else if x < 3 { a = 3; } else if x < 4 { a = 4; } else { a = 5; }
18
+ a = 2;
19
+ } else if x < 3 { a = 3; } else if x < 4 { a = 4; } else { a = 5; }
20
20
21
21
if x < y {
22
22
a += 1;
23
23
a += 1;
24
24
a += 1;
25
25
} else {
26
- a += 1;
27
- a += 1;
28
- a += 1;
29
- a += 1;
30
- a += 1;
31
- a += 1;
32
- a += 1;
33
- a += 1;
34
- a += 1;
35
- a += 1;
36
- a += 1;
37
- a += 1;
38
- a += 1;
39
- a += 1;
40
- a += 1;
41
- }
26
+ a += 1;
27
+ a += 1;
28
+ a += 1;
29
+ a += 1;
30
+ a += 1;
31
+ a += 1;
32
+ a += 1;
33
+ a += 1;
34
+ a += 1;
35
+ a += 1;
36
+ a += 1;
37
+ a += 1;
38
+ a += 1;
39
+ a += 1;
40
+ a += 1;
41
+ }
42
42
43
43
if x < 1 {
44
44
if x < 2 {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ fn main() ({
11
11
(if (true as bool)
12
12
({ } as
13
13
()) else if (let Some(a) =
14
- ((Some as
15
- fn(i32) -> Option<i32> {Option::<i32>::Some})((3 as i32)) as
16
- Option<i32>) as bool) ({ } as ()) as ())
17
- } as ())
14
+ ((Some as
15
+ fn(i32) -> Option<i32> {Option::<i32>::Some})((3 as i32)) as
16
+ Option<i32>) as bool) ({ } as ()) as ())
17
+ } as ())
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ fn main() {
36
36
lit.set_span(crate::Span::recover_proc_macro_span(2));
37
37
lit
38
38
} else {
39
- ::core::panicking::panic("internal error: entered unreachable code")
40
- }
39
+ ::core::panicking::panic("internal error: entered unreachable code")
40
+ }
41
41
}), &mut ts);
42
42
crate::ToTokens::to_tokens(&crate::TokenTree::Punct(crate::Punct::new(';',
43
43
crate::Spacing::Alone)), &mut ts);
@@ -55,8 +55,8 @@ fn main() {
55
55
lit.set_span(crate::Span::recover_proc_macro_span(5));
56
56
lit
57
57
} else {
58
- ::core::panicking::panic("internal error: entered unreachable code")
59
- }
58
+ ::core::panicking::panic("internal error: entered unreachable code")
59
+ }
60
60
}), &mut ts);
61
61
crate::ToTokens::to_tokens(&crate::TokenTree::Punct(crate::Punct::new(';',
62
62
crate::Spacing::Alone)), &mut ts);
You can’t perform that action at this time.
0 commit comments