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> {
4040 | Range ( _, Some ( e) , _)
4141 | Ret ( Some ( e) )
4242 | Unary ( _, e)
43- | Yield ( Some ( e) ) => {
43+ | Yield ( Some ( e) )
44+ | Yeet ( Some ( e) )
45+ | Become ( e) => {
4446 expr = e;
4547 }
4648 Closure ( closure) => {
4749 expr = & closure. body ;
4850 }
4951 Gen ( ..) | Block ( ..) | ForLoop ( ..) | If ( ..) | Loop ( ..) | Match ( ..) | Struct ( ..)
50- | TryBlock ( ..) | While ( ..) => break Some ( expr) ,
52+ | TryBlock ( ..) | While ( ..) | ConstBlock ( _ ) => break Some ( expr) ,
5153 Break ( _, _)
5254 | Range ( _, _, _)
5355 | Ret ( _)
5456 | Yield ( _)
5557 | Array ( _)
56- | ConstBlock ( _)
5758 | Call ( _, _)
5859 | MethodCall ( _)
5960 | Tup ( _)
@@ -66,17 +67,22 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
6667 | Underscore
6768 | Path ( _, _)
6869 | Continue ( _)
69- | InlineAsm ( _)
70- | OffsetOf ( _, _)
71- | MacCall ( _)
7270 | Repeat ( _, _)
7371 | Paren ( _)
7472 | Try ( _)
7573 | Yeet ( _)
76- | Become ( _)
74+ | InlineAsm ( _)
75+ | OffsetOf ( _, _)
76+ | MacCall ( _)
7777 | IncludedBytes ( _)
7878 | 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
8086 }
8187 }
8288}
You can’t perform that action at this time.
0 commit comments