Skip to content

Commit 68800bc

Browse files
maxcabrajacicmccorm
authored andcommitted
GenericParam
1 parent 0eb148d commit 68800bc

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ pub trait MutVisitor: Sized {
287287
walk_variant_data(self, vdata);
288288
}
289289

290+
fn visit_generic_param(&mut self, param: &mut GenericParam) {
291+
walk_generic_param(self, param)
292+
}
293+
290294
fn flat_map_generic_param(&mut self, param: GenericParam) -> SmallVec<[GenericParam; 1]> {
291295
walk_flat_map_generic_param(self, param)
292296
}
@@ -978,11 +982,8 @@ fn walk_precise_capturing_arg<T: MutVisitor>(vis: &mut T, arg: &mut PreciseCaptu
978982
}
979983
}
980984

981-
pub fn walk_flat_map_generic_param<T: MutVisitor>(
982-
vis: &mut T,
983-
mut param: GenericParam,
984-
) -> SmallVec<[GenericParam; 1]> {
985-
let GenericParam { id, ident, attrs, bounds, kind, colon_span, is_placeholder: _ } = &mut param;
985+
pub fn walk_generic_param<T: MutVisitor>(vis: &mut T, param: &mut GenericParam) {
986+
let GenericParam { id, ident, attrs, bounds, kind, colon_span, is_placeholder: _ } = param;
986987
vis.visit_id(id);
987988
visit_attrs(vis, attrs);
988989
vis.visit_ident(ident);
@@ -1000,6 +1001,13 @@ pub fn walk_flat_map_generic_param<T: MutVisitor>(
10001001
if let Some(colon_span) = colon_span {
10011002
vis.visit_span(colon_span);
10021003
}
1004+
}
1005+
1006+
pub fn walk_flat_map_generic_param<T: MutVisitor>(
1007+
vis: &mut T,
1008+
mut param: GenericParam,
1009+
) -> SmallVec<[GenericParam; 1]> {
1010+
vis.visit_generic_param(&mut param);
10031011
smallvec![param]
10041012
}
10051013

0 commit comments

Comments
 (0)