File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
compiler/rustc_ast/src/util Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -40,20 +40,21 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
40
40
| Range ( _, Some ( e) , _)
41
41
| Ret ( Some ( e) )
42
42
| Unary ( _, e)
43
- | Yield ( Some ( e) ) => {
43
+ | Yield ( Some ( e) )
44
+ | Yeet ( Some ( e) )
45
+ | Become ( e) => {
44
46
expr = e;
45
47
}
46
48
Closure ( closure) => {
47
49
expr = & closure. body ;
48
50
}
49
51
Gen ( ..) | Block ( ..) | ForLoop ( ..) | If ( ..) | Loop ( ..) | Match ( ..) | Struct ( ..)
50
- | TryBlock ( ..) | While ( ..) => break Some ( expr) ,
52
+ | TryBlock ( ..) | While ( ..) | ConstBlock ( _ ) => break Some ( expr) ,
51
53
Break ( _, _)
52
54
| Range ( _, _, _)
53
55
| Ret ( _)
54
56
| Yield ( _)
55
57
| Array ( _)
56
- | ConstBlock ( _)
57
58
| Call ( _, _)
58
59
| MethodCall ( _)
59
60
| Tup ( _)
@@ -66,17 +67,22 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
66
67
| Underscore
67
68
| Path ( _, _)
68
69
| Continue ( _)
69
- | InlineAsm ( _)
70
- | OffsetOf ( _, _)
71
- | MacCall ( _)
72
70
| Repeat ( _, _)
73
71
| Paren ( _)
74
72
| Try ( _)
75
73
| Yeet ( _)
76
- | Become ( _)
74
+ | InlineAsm ( _)
75
+ | OffsetOf ( _, _)
76
+ | MacCall ( _)
77
77
| IncludedBytes ( _)
78
78
| FormatArgs ( _)
79
- | Err => break None , // _ => break None,
79
+ | Err => break None ,
80
+ // More complex cases
81
+ // InlineAsm
82
+ // OffsetOf
83
+ // MacCall
84
+ // IncludedBytes
85
+ // FormatArgs
80
86
}
81
87
}
82
88
}
You can’t perform that action at this time.
0 commit comments