@@ -73,12 +73,12 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
73
73
fn stmt ( & mut self , stmt : & hir:: Stmt , pred : CFGIndex ) -> CFGIndex {
74
74
match stmt. node {
75
75
hir:: StmtDecl ( ref decl, id) => {
76
- let exit = self . decl ( & * * decl, pred) ;
76
+ let exit = self . decl ( & decl, pred) ;
77
77
self . add_ast_node ( id, & [ exit] )
78
78
}
79
79
80
80
hir:: StmtExpr ( ref expr, id) | hir:: StmtSemi ( ref expr, id) => {
81
- let exit = self . expr ( & * * expr, pred) ;
81
+ let exit = self . expr ( & expr, pred) ;
82
82
self . add_ast_node ( id, & [ exit] )
83
83
}
84
84
}
@@ -88,7 +88,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
88
88
match decl. node {
89
89
hir:: DeclLocal ( ref local) => {
90
90
let init_exit = self . opt_expr ( & local. init , pred) ;
91
- self . pat ( & * local. pat , init_exit)
91
+ self . pat ( & local. pat , init_exit)
92
92
}
93
93
94
94
hir:: DeclItem ( _) => {
@@ -111,7 +111,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
111
111
hir:: PatBox ( ref subpat) |
112
112
hir:: PatRegion ( ref subpat, _) |
113
113
hir:: PatIdent ( _, _, Some ( ref subpat) ) => {
114
- let subpat_exit = self . pat ( & * * subpat, pred) ;
114
+ let subpat_exit = self . pat ( & subpat, pred) ;
115
115
self . add_ast_node ( pat. id , & [ subpat_exit] )
116
116
}
117
117
@@ -140,13 +140,13 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
140
140
pats : I ,
141
141
pred : CFGIndex ) -> CFGIndex {
142
142
//! Handles case where all of the patterns must match.
143
- pats. fold ( pred, |pred, pat| self . pat ( & * * pat, pred) )
143
+ pats. fold ( pred, |pred, pat| self . pat ( & pat, pred) )
144
144
}
145
145
146
146
fn expr ( & mut self , expr : & hir:: Expr , pred : CFGIndex ) -> CFGIndex {
147
147
match expr. node {
148
148
hir:: ExprBlock ( ref blk) => {
149
- let blk_exit = self . block ( & * * blk, pred) ;
149
+ let blk_exit = self . block ( & blk, pred) ;
150
150
self . add_ast_node ( expr. id , & [ blk_exit] )
151
151
}
152
152
@@ -165,8 +165,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
165
165
// v 3 v 4
166
166
// [..expr..]
167
167
//
168
- let cond_exit = self . expr ( & * * cond, pred) ; // 1
169
- let then_exit = self . block ( & * * then, cond_exit) ; // 2
168
+ let cond_exit = self . expr ( & cond, pred) ; // 1
169
+ let then_exit = self . block ( & then, cond_exit) ; // 2
170
170
self . add_ast_node ( expr. id , & [ cond_exit, then_exit] ) // 3,4
171
171
}
172
172
@@ -185,9 +185,9 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
185
185
// v 4 v 5
186
186
// [..expr..]
187
187
//
188
- let cond_exit = self . expr ( & * * cond, pred) ; // 1
189
- let then_exit = self . block ( & * * then, cond_exit) ; // 2
190
- let else_exit = self . expr ( & * * otherwise, cond_exit) ; // 3
188
+ let cond_exit = self . expr ( & cond, pred) ; // 1
189
+ let then_exit = self . block ( & then, cond_exit) ; // 2
190
+ let else_exit = self . expr ( & otherwise, cond_exit) ; // 3
191
191
self . add_ast_node ( expr. id , & [ then_exit, else_exit] ) // 4, 5
192
192
}
193
193
@@ -211,14 +211,14 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
211
211
212
212
// Is the condition considered part of the loop?
213
213
let loopback = self . add_dummy_node ( & [ pred] ) ; // 1
214
- let cond_exit = self . expr ( & * * cond, loopback) ; // 2
214
+ let cond_exit = self . expr ( & cond, loopback) ; // 2
215
215
let expr_exit = self . add_ast_node ( expr. id , & [ cond_exit] ) ; // 3
216
216
self . loop_scopes . push ( LoopScope {
217
217
loop_id : expr. id ,
218
218
continue_index : loopback,
219
219
break_index : expr_exit
220
220
} ) ;
221
- let body_exit = self . block ( & * * body, cond_exit) ; // 4
221
+ let body_exit = self . block ( & body, cond_exit) ; // 4
222
222
self . add_contained_edge ( body_exit, loopback) ; // 5
223
223
self . loop_scopes . pop ( ) ;
224
224
expr_exit
@@ -246,7 +246,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
246
246
continue_index : loopback,
247
247
break_index : expr_exit,
248
248
} ) ;
249
- let body_exit = self . block ( & * * body, loopback) ; // 3
249
+ let body_exit = self . block ( & body, loopback) ; // 3
250
250
self . add_contained_edge ( body_exit, loopback) ; // 4
251
251
self . loop_scopes . pop ( ) ;
252
252
expr_exit
@@ -271,8 +271,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
271
271
// v 3 v 4
272
272
// [..exit..]
273
273
//
274
- let l_exit = self . expr ( & * * l, pred) ; // 1
275
- let r_exit = self . expr ( & * * r, l_exit) ; // 2
274
+ let l_exit = self . expr ( & l, pred) ; // 1
275
+ let r_exit = self . expr ( & r, l_exit) ; // 2
276
276
self . add_ast_node ( expr. id , & [ l_exit, r_exit] ) // 3,4
277
277
}
278
278
@@ -304,16 +304,16 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
304
304
}
305
305
306
306
hir:: ExprCall ( ref func, ref args) => {
307
- self . call ( expr, pred, & * * func, args. iter ( ) . map ( |e| & * * e) )
307
+ self . call ( expr, pred, & func, args. iter ( ) . map ( |e| & * * e) )
308
308
}
309
309
310
310
hir:: ExprMethodCall ( _, _, ref args) => {
311
- self . call ( expr, pred, & * args[ 0 ] , args[ 1 ..] . iter ( ) . map ( |e| & * * e) )
311
+ self . call ( expr, pred, & args[ 0 ] , args[ 1 ..] . iter ( ) . map ( |e| & * * e) )
312
312
}
313
313
314
314
hir:: ExprIndex ( ref l, ref r) |
315
315
hir:: ExprBinary ( _, ref l, ref r) if self . tcx . is_method_call ( expr. id ) => {
316
- self . call ( expr, pred, & * * l, Some ( & * * r) . into_iter ( ) )
316
+ self . call ( expr, pred, & l, Some ( & * * r) . into_iter ( ) )
317
317
}
318
318
319
319
hir:: ExprRange ( ref start, ref end) => {
@@ -323,7 +323,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
323
323
}
324
324
325
325
hir:: ExprUnary ( _, ref e) if self . tcx . is_method_call ( expr. id ) => {
326
- self . call ( expr, pred, & * * e, None :: < hir:: Expr > . iter ( ) )
326
+ self . call ( expr, pred, & e, None :: < hir:: Expr > . iter ( ) )
327
327
}
328
328
329
329
hir:: ExprTup ( ref exprs) => {
@@ -413,7 +413,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
413
413
opt_expr : & Option < P < hir:: Expr > > ,
414
414
pred : CFGIndex ) -> CFGIndex {
415
415
//! Constructs graph for `opt_expr` evaluated, if Some
416
- opt_expr. iter ( ) . fold ( pred, |p, e| self . expr ( & * * e, p) )
416
+ opt_expr. iter ( ) . fold ( pred, |p, e| self . expr ( & e, p) )
417
417
}
418
418
419
419
fn straightline < ' b , I : Iterator < Item =& ' b hir:: Expr > > ( & mut self ,
@@ -461,18 +461,18 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
461
461
462
462
for pat in & arm. pats {
463
463
// Visit the pattern, coming from the discriminant exit
464
- let mut pat_exit = self . pat ( & * * pat, discr_exit) ;
464
+ let mut pat_exit = self . pat ( & pat, discr_exit) ;
465
465
466
466
// If there is a guard expression, handle it here
467
467
if let Some ( ref guard) = arm. guard {
468
468
// Add a dummy node for the previous guard
469
469
// expression to target
470
470
let guard_start = self . add_dummy_node ( & [ pat_exit] ) ;
471
471
// Visit the guard expression
472
- let guard_exit = self . expr ( & * * guard, guard_start) ;
472
+ let guard_exit = self . expr ( & guard, guard_start) ;
473
473
474
474
let this_has_bindings = pat_util:: pat_contains_bindings_or_wild (
475
- & self . tcx . def_map . borrow ( ) , & * * pat) ;
475
+ & self . tcx . def_map . borrow ( ) , & pat) ;
476
476
477
477
// If both this pattern and the previous pattern
478
478
// were free of bindings, they must consist only
0 commit comments