File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,9 @@ impl ExpressionStore {
282
282
}
283
283
}
284
284
285
+ /// Walks the immediate children expressions and calls `f` for each child expression.
286
+ ///
287
+ /// Note that this does not walk const blocks.
285
288
pub fn walk_child_exprs ( & self , expr_id : ExprId , mut f : impl FnMut ( ExprId ) ) {
286
289
let expr = & self [ expr_id] ;
287
290
match expr {
@@ -415,6 +418,10 @@ impl ExpressionStore {
415
418
}
416
419
}
417
420
421
+ /// Walks the immediate children expressions and calls `f` for each child expression but does
422
+ /// not walk expressions within patterns.
423
+ ///
424
+ /// Note that this does not walk const blocks.
418
425
pub fn walk_child_exprs_without_pats ( & self , expr_id : ExprId , mut f : impl FnMut ( ExprId ) ) {
419
426
let expr = & self [ expr_id] ;
420
427
match expr {
Original file line number Diff line number Diff line change @@ -348,6 +348,7 @@ impl<'a> UnsafeVisitor<'a> {
348
348
Expr :: Closure { args, .. } => {
349
349
self . walk_pats_top ( args. iter ( ) . copied ( ) , current) ;
350
350
}
351
+ Expr :: Const ( e) => self . walk_expr ( * e) ,
351
352
_ => { }
352
353
}
353
354
You can’t perform that action at this time.
0 commit comments