@@ -8,9 +8,9 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
88use rustc_hir as hir;
99use rustc_hir:: def:: { CtorKind , DefKind , Res } ;
1010use rustc_hir:: def_id:: DefId ;
11- use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
12- use rustc_hir:: { Expr , ExprKind , Pat , PatKind , Arm , Guard , HirId } ;
1311use rustc_hir:: hir_id:: HirIdSet ;
12+ use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
13+ use rustc_hir:: { Arm , Expr , ExprKind , Guard , HirId , Pat , PatKind } ;
1414use rustc_middle:: middle:: region:: { self , YieldData } ;
1515use rustc_middle:: ty:: { self , Ty } ;
1616use rustc_span:: Span ;
@@ -64,7 +64,9 @@ impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> {
6464 yield_data. expr_and_pat_count, self . expr_count, source_span
6565 ) ;
6666
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+ {
6870 Some ( yield_data)
6971 } else {
7072 None
@@ -239,7 +241,10 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
239241 let mut scope_var_ids =
240242 self . nested_scope_of_guards . pop ( ) . expect ( "should have pushed at least one earlier" ) ;
241243 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+ ) ;
243248 }
244249 self . arm_has_guard = false ;
245250 }
@@ -289,7 +294,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
289294 }
290295 }
291296 _ => intravisit:: walk_expr ( self , expr) ,
292- }
297+ } ,
293298 ExprKind :: Path ( qpath) => {
294299 intravisit:: walk_expr ( self , expr) ;
295300 let res = self . fcx . typeck_results . borrow ( ) . qpath_res ( qpath, expr. hir_id ) ;
0 commit comments