Add support for parsing const parameters
diff --git a/src/gen/fold.rs b/src/gen/fold.rs
index 186e380..ed7db7c 100644
--- a/src/gen/fold.rs
+++ b/src/gen/fold.rs
@@ -97,6 +97,8 @@
fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
+
+fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -752,6 +754,18 @@
Ref => { Ref }
}
}
+
+pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
+ ConstParam {
+ attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
+ const_token: _i . const_token,
+ ident: _i . ident,
+ colon_token: _i . colon_token,
+ ty: _visitor.fold_type(_i . ty),
+ eq_token: _i . eq_token,
+ default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
+ }
+}
# [ cfg ( feature = "full" ) ]
pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
use ::Constness::*;
@@ -1491,6 +1505,11 @@
_visitor.fold_type_param(_binding_0),
)
}
+ Const(_binding_0, ) => {
+ Const (
+ _visitor.fold_const_param(_binding_0),
+ )
+ }
}
}