@@ -8,9 +8,9 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
8
8
use rustc_hir as hir;
9
9
use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
10
10
use rustc_hir:: def_id:: DefId ;
11
- use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
12
- use rustc_hir:: { Expr , ExprKind , Pat , PatKind , Arm , Guard , HirId } ;
13
11
use rustc_hir:: hir_id:: HirIdSet ;
12
+ use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
13
+ use rustc_hir:: { Arm , Expr , ExprKind , Guard , HirId , Pat , PatKind } ;
14
14
use rustc_middle:: middle:: region:: { self , YieldData } ;
15
15
use rustc_middle:: ty:: { self , Ty } ;
16
16
use rustc_span:: Span ;
@@ -64,7 +64,9 @@ impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> {
64
64
yield_data. expr_and_pat_count, self . expr_count, source_span
65
65
) ;
66
66
67
- if guard_borrowing_from_pattern || yield_data. expr_and_pat_count >= self . expr_count {
67
+ if guard_borrowing_from_pattern
68
+ || yield_data. expr_and_pat_count >= self . expr_count
69
+ {
68
70
Some ( yield_data)
69
71
} else {
70
72
None
@@ -239,7 +241,10 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
239
241
let mut scope_var_ids =
240
242
self . nested_scope_of_guards . pop ( ) . expect ( "should have pushed at least one earlier" ) ;
241
243
for var_id in scope_var_ids. drain ( ..) {
242
- assert ! ( self . current_scope_of_guards. remove( & var_id) , "variable should be placed in scope earlier" ) ;
244
+ assert ! (
245
+ self . current_scope_of_guards. remove( & var_id) ,
246
+ "variable should be placed in scope earlier"
247
+ ) ;
243
248
}
244
249
self . arm_has_guard = false ;
245
250
}
@@ -289,7 +294,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
289
294
}
290
295
}
291
296
_ => intravisit:: walk_expr ( self , expr) ,
292
- }
297
+ } ,
293
298
ExprKind :: Path ( qpath) => {
294
299
intravisit:: walk_expr ( self , expr) ;
295
300
let res = self . fcx . typeck_results . borrow ( ) . qpath_res ( qpath, expr. hir_id ) ;
0 commit comments