Skip to content

Commit 0eb148d

Browse files
maxcabrajacicmccorm
authored andcommitted
Param
1 parent c9c2feb commit 0eb148d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ pub trait MutVisitor: Sized {
263263
walk_attribute(self, at);
264264
}
265265

266+
fn visit_param(&mut self, param: &mut Param) {
267+
walk_param(self, param);
268+
}
269+
266270
fn flat_map_param(&mut self, param: Param) -> SmallVec<[Param; 1]> {
267271
walk_flat_map_param(self, param)
268272
}
@@ -705,13 +709,17 @@ fn walk_meta_item<T: MutVisitor>(vis: &mut T, mi: &mut MetaItem) {
705709
vis.visit_span(span);
706710
}
707711

708-
pub fn walk_flat_map_param<T: MutVisitor>(vis: &mut T, mut param: Param) -> SmallVec<[Param; 1]> {
709-
let Param { attrs, id, pat, span, ty, is_placeholder: _ } = &mut param;
712+
pub fn walk_param<T: MutVisitor>(vis: &mut T, param: &mut Param) {
713+
let Param { attrs, id, pat, span, ty, is_placeholder: _ } = param;
710714
vis.visit_id(id);
711715
visit_attrs(vis, attrs);
712716
vis.visit_pat(pat);
713717
vis.visit_ty(ty);
714718
vis.visit_span(span);
719+
}
720+
721+
pub fn walk_flat_map_param<T: MutVisitor>(vis: &mut T, mut param: Param) -> SmallVec<[Param; 1]> {
722+
vis.visit_param(&mut param);
715723
smallvec![param]
716724
}
717725

0 commit comments

Comments
 (0)