@@ -73,19 +73,19 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
7373
7474 let expr_exit = self . opt_expr ( & blk. expr , stmts_exit) ;
7575
76- self . add_node ( blk. id , [ expr_exit] )
76+ self . add_node ( blk. id , & [ expr_exit] )
7777 }
7878
7979 fn stmt ( & mut self , stmt : & ast:: Stmt , pred : CFGIndex ) -> CFGIndex {
8080 match stmt. node {
8181 ast:: StmtDecl ( ref decl, id) => {
8282 let exit = self . decl ( & * * decl, pred) ;
83- self . add_node ( id, [ exit] )
83+ self . add_node ( id, & [ exit] )
8484 }
8585
8686 ast:: StmtExpr ( ref expr, id) | ast:: StmtSemi ( ref expr, id) => {
8787 let exit = self . expr ( & * * expr, pred) ;
88- self . add_node ( id, [ exit] )
88+ self . add_node ( id, & [ exit] )
8989 }
9090
9191 ast:: StmtMac ( ..) => {
@@ -114,33 +114,33 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
114114 ast:: PatLit ( ..) |
115115 ast:: PatRange ( ..) |
116116 ast:: PatWild ( _) => {
117- self . add_node ( pat. id , [ pred] )
117+ self . add_node ( pat. id , & [ pred] )
118118 }
119119
120120 ast:: PatBox ( ref subpat) |
121121 ast:: PatRegion ( ref subpat) |
122122 ast:: PatIdent ( _, _, Some ( ref subpat) ) => {
123123 let subpat_exit = self . pat ( & * * subpat, pred) ;
124- self . add_node ( pat. id , [ subpat_exit] )
124+ self . add_node ( pat. id , & [ subpat_exit] )
125125 }
126126
127127 ast:: PatEnum ( _, Some ( ref subpats) ) |
128128 ast:: PatTup ( ref subpats) => {
129129 let pats_exit = self . pats_all ( subpats. iter ( ) , pred) ;
130- self . add_node ( pat. id , [ pats_exit] )
130+ self . add_node ( pat. id , & [ pats_exit] )
131131 }
132132
133133 ast:: PatStruct ( _, ref subpats, _) => {
134134 let pats_exit =
135135 self . pats_all ( subpats. iter ( ) . map ( |f| & f. node . pat ) , pred) ;
136- self . add_node ( pat. id , [ pats_exit] )
136+ self . add_node ( pat. id , & [ pats_exit] )
137137 }
138138
139139 ast:: PatVec ( ref pre, ref vec, ref post) => {
140140 let pre_exit = self . pats_all ( pre. iter ( ) , pred) ;
141141 let vec_exit = self . pats_all ( vec. iter ( ) , pre_exit) ;
142142 let post_exit = self . pats_all ( post. iter ( ) , vec_exit) ;
143- self . add_node ( pat. id , [ post_exit] )
143+ self . add_node ( pat. id , & [ post_exit] )
144144 }
145145
146146 ast:: PatMac ( _) => {
@@ -165,7 +165,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
165165 if pats. len ( ) == 1 {
166166 self . pat ( & * pats[ 0 ] , pred)
167167 } else {
168- let collect = self . add_dummy_node ( [ ] ) ;
168+ let collect = self . add_dummy_node ( & [ ] ) ;
169169 for pat in pats. iter ( ) {
170170 let pat_exit = self . pat ( & * * pat, pred) ;
171171 self . add_contained_edge ( pat_exit, collect) ;
@@ -178,7 +178,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
178178 match expr. node {
179179 ast:: ExprBlock ( ref blk) => {
180180 let blk_exit = self . block ( & * * blk, pred) ;
181- self . add_node ( expr. id , [ blk_exit] )
181+ self . add_node ( expr. id , & [ blk_exit] )
182182 }
183183
184184 ast:: ExprIf ( ref cond, ref then, None ) => {
@@ -198,7 +198,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
198198 //
199199 let cond_exit = self . expr ( & * * cond, pred) ; // 1
200200 let then_exit = self . block ( & * * then, cond_exit) ; // 2
201- self . add_node ( expr. id , [ cond_exit, then_exit] ) // 3,4
201+ self . add_node ( expr. id , & [ cond_exit, then_exit] ) // 3,4
202202 }
203203
204204 ast:: ExprIf ( ref cond, ref then, Some ( ref otherwise) ) => {
@@ -219,7 +219,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
219219 let cond_exit = self . expr ( & * * cond, pred) ; // 1
220220 let then_exit = self . block ( & * * then, cond_exit) ; // 2
221221 let else_exit = self . expr ( & * * otherwise, cond_exit) ; // 3
222- self . add_node ( expr. id , [ then_exit, else_exit] ) // 4, 5
222+ self . add_node ( expr. id , & [ then_exit, else_exit] ) // 4, 5
223223 }
224224
225225 ast:: ExprIfLet ( ..) => {
@@ -245,9 +245,9 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
245245 // may cause additional edges.
246246
247247 // Is the condition considered part of the loop?
248- let loopback = self . add_dummy_node ( [ pred] ) ; // 1
249- let cond_exit = self . expr ( & * * cond, loopback) ; // 2
250- let expr_exit = self . add_node ( expr. id , [ cond_exit] ) ; // 3
248+ let loopback = self . add_dummy_node ( & [ pred] ) ; // 1
249+ let cond_exit = self . expr ( & * * cond, loopback) ; // 2
250+ let expr_exit = self . add_node ( expr. id , & [ cond_exit] ) ; // 3
251251 self . loop_scopes . push ( LoopScope {
252252 loop_id : expr. id ,
253253 continue_index : loopback,
@@ -286,10 +286,10 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
286286 // Note that `break` and `continue` statements
287287 // may cause additional edges.
288288
289- let head = self . expr ( & * * head, pred) ; // 1
290- let loopback = self . add_dummy_node ( [ head] ) ; // 2
291- let cond = self . add_dummy_node ( [ loopback] ) ; // 3
292- let expr_exit = self . add_node ( expr. id , [ cond] ) ; // 4
289+ let head = self . expr ( & * * head, pred) ; // 1
290+ let loopback = self . add_dummy_node ( & [ head] ) ; // 2
291+ let cond = self . add_dummy_node ( & [ loopback] ) ; // 3
292+ let expr_exit = self . add_node ( expr. id , & [ cond] ) ; // 4
293293 self . loop_scopes . push ( LoopScope {
294294 loop_id : expr. id ,
295295 continue_index : loopback,
@@ -317,8 +317,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
317317 // Note that `break` and `loop` statements
318318 // may cause additional edges.
319319
320- let loopback = self . add_dummy_node ( [ pred] ) ; // 1
321- let expr_exit = self . add_node ( expr. id , [ ] ) ; // 2
320+ let loopback = self . add_dummy_node ( & [ pred] ) ; // 1
321+ let expr_exit = self . add_node ( expr. id , & [ ] ) ; // 2
322322 self . loop_scopes . push ( LoopScope {
323323 loop_id : expr. id ,
324324 continue_index : loopback,
@@ -358,10 +358,10 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
358358 //
359359 let discr_exit = self . expr ( & * * discr, pred) ; // 1
360360
361- let expr_exit = self . add_node ( expr. id , [ ] ) ;
361+ let expr_exit = self . add_node ( expr. id , & [ ] ) ;
362362 let mut cond_exit = discr_exit;
363363 for arm in arms. iter ( ) {
364- cond_exit = self . add_dummy_node ( [ cond_exit] ) ; // 2
364+ cond_exit = self . add_dummy_node ( & [ cond_exit] ) ; // 2
365365 let pats_exit = self . pats_any ( arm. pats . as_slice ( ) ,
366366 cond_exit) ; // 3
367367 let guard_exit = self . opt_expr ( & arm. guard ,
@@ -389,30 +389,30 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
389389 //
390390 let l_exit = self . expr ( & * * l, pred) ; // 1
391391 let r_exit = self . expr ( & * * r, l_exit) ; // 2
392- self . add_node ( expr. id , [ l_exit, r_exit] ) // 3,4
392+ self . add_node ( expr. id , & [ l_exit, r_exit] ) // 3,4
393393 }
394394
395395 ast:: ExprRet ( ref v) => {
396396 let v_exit = self . opt_expr ( v, pred) ;
397- let b = self . add_node ( expr. id , [ v_exit] ) ;
397+ let b = self . add_node ( expr. id , & [ v_exit] ) ;
398398 self . add_returning_edge ( expr, b) ;
399- self . add_node ( ast:: DUMMY_NODE_ID , [ ] )
399+ self . add_node ( ast:: DUMMY_NODE_ID , & [ ] )
400400 }
401401
402402 ast:: ExprBreak ( label) => {
403403 let loop_scope = self . find_scope ( expr, label) ;
404- let b = self . add_node ( expr. id , [ pred] ) ;
404+ let b = self . add_node ( expr. id , & [ pred] ) ;
405405 self . add_exiting_edge ( expr, b,
406406 loop_scope, loop_scope. break_index ) ;
407- self . add_node ( ast:: DUMMY_NODE_ID , [ ] )
407+ self . add_node ( ast:: DUMMY_NODE_ID , & [ ] )
408408 }
409409
410410 ast:: ExprAgain ( label) => {
411411 let loop_scope = self . find_scope ( expr, label) ;
412- let a = self . add_node ( expr. id , [ pred] ) ;
412+ let a = self . add_node ( expr. id , & [ pred] ) ;
413413 self . add_exiting_edge ( expr, a,
414414 loop_scope, loop_scope. continue_index ) ;
415- self . add_node ( ast:: DUMMY_NODE_ID , [ ] )
415+ self . add_node ( ast:: DUMMY_NODE_ID , & [ ] )
416416 }
417417
418418 ast:: ExprVec ( ref elems) => {
@@ -492,7 +492,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
492492 let & ( _, ref expr, _) = a;
493493 & * * expr
494494 } ) , post_inputs) ;
495- self . add_node ( expr. id , [ post_outputs] )
495+ self . add_node ( expr. id , & [ post_outputs] )
496496 }
497497
498498 ast:: ExprMac ( ..) |
@@ -520,7 +520,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
520520 let func_or_rcvr_exit = self . expr ( func_or_rcvr, pred) ;
521521 let ret = self . straightline ( call_expr, func_or_rcvr_exit, args) ;
522522 if return_ty == ty:: FnDiverging {
523- self . add_node ( ast:: DUMMY_NODE_ID , [ ] )
523+ self . add_node ( ast:: DUMMY_NODE_ID , & [ ] )
524524 } else {
525525 ret
526526 }
@@ -547,7 +547,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
547547 //! Handles case of an expression that evaluates `subexprs` in order
548548
549549 let subexprs_exit = self . exprs ( subexprs, pred) ;
550- self . add_node ( expr. id , [ subexprs_exit] )
550+ self . add_node ( expr. id , & [ subexprs_exit] )
551551 }
552552
553553 fn add_dummy_node ( & mut self , preds : & [ CFGIndex ] ) -> CFGIndex {
0 commit comments