Rename Ty -> Type
Rust source code does not abbreviate type -> ty (the way it abbreviates impl and
mod, for example). This commit updates the naming in syn to reflect that.
diff --git a/src/data.rs b/src/data.rs
index 56004a1..7c97311 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -70,7 +70,7 @@
pub attrs: Vec<Attribute>,
/// Type of the field.
- pub ty: Ty,
+ pub ty: Type,
pub colon_token: Option<Token![:]>,
}
@@ -116,7 +116,7 @@
vis: syn!(Visibility) >>
id: syn!(Ident) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
(Field {
ident: Some(id),
vis: vis,
@@ -129,7 +129,7 @@
named!(pub parse_tuple -> Self, do_parse!(
attrs: many0!(call!(Attribute::parse_outer)) >>
vis: syn!(Visibility) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
(Field {
ident: None,
colon_token: None,
diff --git a/src/expr.rs b/src/expr.rs
index 3271431..df930ba 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -52,7 +52,7 @@
/// A method call (`x.foo::<Bar, Baz>(a, b, c, d)`)
///
/// The `Ident` is the identifier for the method name.
- /// The vector of `Ty`s are the ascripted type parameters for the method
+ /// The vector of `Type`s are the ascripted type parameters for the method
/// (within the angle brackets).
///
/// Thus, `x.foo::<Bar, Baz>(a, b, c, d)` is represented as
@@ -60,7 +60,7 @@
pub MethodCall(ExprMethodCall #full {
pub expr: Box<Expr>,
pub method: Ident,
- pub typarams: Delimited<Ty, Token![,]>,
+ pub typarams: Delimited<Type, Token![,]>,
pub args: Delimited<Expr, Token![,]>,
pub paren_token: tokens::Paren,
pub dot_token: Token![.],
@@ -96,14 +96,14 @@
pub Cast(ExprCast {
pub expr: Box<Expr>,
pub as_token: Token![as],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
}),
/// A type ascription, e.g. `foo: f64`.
pub Type(ExprType {
pub expr: Box<Expr>,
pub colon_token: Token![:],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
}),
/// An `if` block, with an optional else block
@@ -440,7 +440,7 @@
pub semi_token: Token![;],
pub pat: Box<Pat>,
- pub ty: Option<Box<Ty>>,
+ pub ty: Option<Box<Type>>,
/// Initializer expression to set the value, if any
pub init: Option<Box<Expr>>,
@@ -974,7 +974,7 @@
as_: keyword!(as) >>
// We can't accept `A + B` in cast expressions, as it's
// ambiguous with the + expression.
- ty: call!(Ty::without_plus) >>
+ ty: call!(Type::without_plus) >>
({
e = ExprCast {
expr: Box::new(e.into()),
@@ -988,7 +988,7 @@
colon: punct!(:) >>
// We can't accept `A + B` in cast expressions, as it's
// ambiguous with the + expression.
- ty: call!(Ty::without_plus) >>
+ ty: call!(Type::without_plus) >>
({
e = ExprType {
expr: Box::new(e.into()),
@@ -1533,9 +1533,9 @@
ret_and_body: alt!(
do_parse!(
arrow: punct!(->) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
body: syn!(Block) >>
- (ReturnType::Ty(ty, arrow),
+ (ReturnType::Type(ty, arrow),
ExprKind::Block(ExprBlock {
unsafety: Unsafety::Normal,
block: body,
@@ -1564,10 +1564,10 @@
#[cfg(feature = "full")]
named!(fn_arg -> FnArg, do_parse!(
pat: syn!(Pat) >>
- ty: option!(tuple!(punct!(:), syn!(Ty))) >>
+ ty: option!(tuple!(punct!(:), syn!(Type))) >>
({
let (colon, ty) = ty.unwrap_or_else(|| {
- (<Token![:]>::default(), TyInfer {
+ (<Token![:]>::default(), TypeInfer {
underscore_token: <Token![_]>::default(),
}.into())
});
@@ -1867,7 +1867,7 @@
attrs: many0!(call!(Attribute::parse_outer)) >>
let_: keyword!(let) >>
pat: syn!(Pat) >>
- ty: option!(tuple!(punct!(:), syn!(Ty))) >>
+ ty: option!(tuple!(punct!(:), syn!(Type))) >>
init: option!(tuple!(punct!(=), syn!(Expr))) >>
semi: punct!(;) >>
(Stmt::Local(Box::new(Local {
@@ -2554,7 +2554,7 @@
self.or1_token.to_tokens(tokens);
for item in self.decl.inputs.iter() {
match **item.item() {
- FnArg::Captured(ArgCaptured { ref pat, ty: Ty::Infer(_), .. }) => {
+ FnArg::Captured(ArgCaptured { ref pat, ty: Type::Infer(_), .. }) => {
pat.to_tokens(tokens);
}
_ => item.item().to_tokens(tokens),
diff --git a/src/gen/fold.rs b/src/gen/fold.rs
index 0695bcf..4ab418a 100644
--- a/src/gen/fold.rs
+++ b/src/gen/fold.rs
@@ -80,7 +80,7 @@
fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
-fn fold_bare_fn_ty(&mut self, i: BareFnTy) -> BareFnTy { fold_bare_fn_ty(self, i) }
+fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -242,7 +242,7 @@
# [ cfg ( feature = "full" ) ]
fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
# [ cfg ( feature = "full" ) ]
-fn fold_item_ty(&mut self, i: ItemTy) -> ItemTy { fold_item_ty(self, i) }
+fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -264,7 +264,7 @@
# [ cfg ( feature = "full" ) ]
fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
-fn fold_mut_ty(&mut self, i: MutTy) -> MutTy { fold_mut_ty(self, i) }
+fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
@@ -332,40 +332,40 @@
# [ cfg ( feature = "full" ) ]
fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
-fn fold_ty(&mut self, i: Ty) -> Ty { fold_ty(self, i) }
+fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
-fn fold_ty_array(&mut self, i: TyArray) -> TyArray { fold_ty_array(self, i) }
+fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
-fn fold_ty_bare_fn(&mut self, i: TyBareFn) -> TyBareFn { fold_ty_bare_fn(self, i) }
-
-fn fold_ty_group(&mut self, i: TyGroup) -> TyGroup { fold_ty_group(self, i) }
-
-fn fold_ty_impl_trait(&mut self, i: TyImplTrait) -> TyImplTrait { fold_ty_impl_trait(self, i) }
-
-fn fold_ty_infer(&mut self, i: TyInfer) -> TyInfer { fold_ty_infer(self, i) }
-
-fn fold_ty_never(&mut self, i: TyNever) -> TyNever { fold_ty_never(self, i) }
-
-fn fold_ty_param(&mut self, i: TyParam) -> TyParam { fold_ty_param(self, i) }
-
-fn fold_ty_param_bound(&mut self, i: TyParamBound) -> TyParamBound { fold_ty_param_bound(self, i) }
-
-fn fold_ty_paren(&mut self, i: TyParen) -> TyParen { fold_ty_paren(self, i) }
-
-fn fold_ty_path(&mut self, i: TyPath) -> TyPath { fold_ty_path(self, i) }
-
-fn fold_ty_ptr(&mut self, i: TyPtr) -> TyPtr { fold_ty_ptr(self, i) }
-
-fn fold_ty_rptr(&mut self, i: TyRptr) -> TyRptr { fold_ty_rptr(self, i) }
-
-fn fold_ty_slice(&mut self, i: TySlice) -> TySlice { fold_ty_slice(self, i) }
-
-fn fold_ty_trait_object(&mut self, i: TyTraitObject) -> TyTraitObject { fold_ty_trait_object(self, i) }
-
-fn fold_ty_tup(&mut self, i: TyTup) -> TyTup { fold_ty_tup(self, i) }
+fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
+fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
+
+fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
+
+fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
+
+fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
+
+fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
+
+fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
+
+fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
+
+fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
+
+fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
+
+fn fold_type_rptr(&mut self, i: TypeRptr) -> TypeRptr { fold_type_rptr(self, i) }
+
+fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
+
+fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
+
+fn fold_type_tup(&mut self, i: TypeTup) -> TypeTup { fold_type_tup(self, i) }
+
fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
@@ -423,7 +423,7 @@
turbofish: _i . turbofish,
lt_token: _i . lt_token,
lifetimes: _i . lifetimes,
- types: FoldHelper::lift(_i . types, |it| { _visitor.fold_ty(it) }),
+ types: FoldHelper::lift(_i . types, |it| { _visitor.fold_type(it) }),
bindings: FoldHelper::lift(_i . bindings, |it| { _visitor.fold_type_binding(it) }),
gt_token: _i . gt_token,
}
@@ -433,7 +433,7 @@
ArgCaptured {
pat: _visitor.fold_pat(_i . pat),
colon_token: _i . colon_token,
- ty: _visitor.fold_ty(_i . ty),
+ ty: _visitor.fold_type(_i . ty),
}
}
# [ cfg ( feature = "full" ) ]
@@ -491,7 +491,7 @@
pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
BareFnArg {
name: _i . name,
- ty: _visitor.fold_ty(_i . ty),
+ ty: _visitor.fold_type(_i . ty),
}
}
@@ -511,8 +511,8 @@
}
}
-pub fn fold_bare_fn_ty<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnTy) -> BareFnTy {
- BareFnTy {
+pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
+ BareFnType {
lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
unsafety: _visitor.fold_unsafety(_i . unsafety),
abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
@@ -861,7 +861,7 @@
ExprCast {
expr: Box::new(_visitor.fold_expr(* _i . expr)),
as_token: _i . as_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
}
}
# [ cfg ( feature = "full" ) ]
@@ -1179,7 +1179,7 @@
ExprMethodCall {
expr: Box::new(_visitor.fold_expr(* _i . expr)),
method: _i . method,
- typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_ty(it) }),
+ typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
paren_token: _i . paren_token,
dot_token: _i . dot_token,
@@ -1264,7 +1264,7 @@
ExprType {
expr: Box::new(_visitor.fold_expr(* _i . expr)),
colon_token: _i . colon_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
}
}
@@ -1310,7 +1310,7 @@
ident: _i . ident,
vis: _visitor.fold_visibility(_i . vis),
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
- ty: _visitor.fold_ty(_i . ty),
+ ty: _visitor.fold_type(_i . ty),
colon_token: _i . colon_token,
}
}
@@ -1363,7 +1363,7 @@
}
Ignored(_binding_0, ) => {
Ignored (
- _visitor.fold_ty(_binding_0),
+ _visitor.fold_type(_binding_0),
)
}
}
@@ -1415,7 +1415,7 @@
mutbl: _visitor.fold_mutability(_i . mutbl),
ident: _i . ident,
colon_token: _i . colon_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
semi_token: _i . semi_token,
}
}
@@ -1425,7 +1425,7 @@
lt_token: _i . lt_token,
gt_token: _i . gt_token,
lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
- ty_params: FoldHelper::lift(_i . ty_params, |it| { _visitor.fold_ty_param(it) }),
+ ty_params: FoldHelper::lift(_i . ty_params, |it| { _visitor.fold_type_param(it) }),
where_clause: _visitor.fold_where_clause(_i . where_clause),
}
}
@@ -1464,7 +1464,7 @@
const_token: _i . const_token,
ident: _i . ident,
colon_token: _i . colon_token,
- ty: _visitor.fold_ty(_i . ty),
+ ty: _visitor.fold_type(_i . ty),
eq_token: _i . eq_token,
expr: _visitor.fold_expr(_i . expr),
semi_token: _i . semi_token,
@@ -1496,7 +1496,7 @@
type_token: _i . type_token,
ident: _i . ident,
eq_token: _i . eq_token,
- ty: _visitor.fold_ty(_i . ty),
+ ty: _visitor.fold_type(_i . ty),
semi_token: _i . semi_token,
}
}
@@ -1567,9 +1567,9 @@
_visitor.fold_item_foreign_mod(_binding_0),
)
}
- Ty(_binding_0, ) => {
- Ty (
- _visitor.fold_item_ty(_binding_0),
+ Type(_binding_0, ) => {
+ Type (
+ _visitor.fold_item_type(_binding_0),
)
}
Enum(_binding_0, ) => {
@@ -1617,7 +1617,7 @@
const_token: _i . const_token,
ident: _i . ident,
colon_token: _i . colon_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
eq_token: _i . eq_token,
expr: Box::new(_visitor.fold_expr(* _i . expr)),
semi_token: _i . semi_token,
@@ -1690,7 +1690,7 @@
impl_token: _i . impl_token,
generics: _visitor.fold_generics(_i . generics),
trait_: _i . trait_,
- self_ty: Box::new(_visitor.fold_ty(* _i . self_ty)),
+ self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
brace_token: _i . brace_token,
items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
}
@@ -1723,7 +1723,7 @@
mutbl: _visitor.fold_mutability(_i . mutbl),
ident: _i . ident,
colon_token: _i . colon_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
eq_token: _i . eq_token,
expr: Box::new(_visitor.fold_expr(* _i . expr)),
semi_token: _i . semi_token,
@@ -1751,21 +1751,21 @@
ident: _i . ident,
generics: _visitor.fold_generics(_i . generics),
colon_token: _i . colon_token,
- supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_ty_param_bound(it) }),
+ supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
brace_token: _i . brace_token,
items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
}
}
# [ cfg ( feature = "full" ) ]
-pub fn fold_item_ty<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTy) -> ItemTy {
- ItemTy {
+pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
+ ItemType {
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
vis: _visitor.fold_visibility(_i . vis),
type_token: _i . type_token,
ident: _i . ident,
generics: _visitor.fold_generics(_i . generics),
eq_token: _i . eq_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
semi_token: _i . semi_token,
}
}
@@ -1807,7 +1807,7 @@
eq_token: _i . eq_token,
semi_token: _i . semi_token,
pat: Box::new(_visitor.fold_pat(* _i . pat)),
- ty: (_i . ty).map(|it| { Box::new(_visitor.fold_ty(* it)) }),
+ ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
}
@@ -1881,9 +1881,9 @@
}
}
-pub fn fold_mut_ty<V: Folder + ?Sized>(_visitor: &mut V, _i: MutTy) -> MutTy {
- MutTy {
- ty: _visitor.fold_ty(_i . ty),
+pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
+ MutType {
+ ty: _visitor.fold_type(_i . ty),
mutability: _visitor.fold_mutability(_i . mutability),
}
}
@@ -1919,7 +1919,7 @@
pub fn fold_parenthesized_parameter_data<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedParameterData) -> ParenthesizedParameterData {
ParenthesizedParameterData {
paren_token: _i . paren_token,
- inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_ty(it) }),
+ inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
output: _visitor.fold_return_type(_i . output),
}
}
@@ -2152,7 +2152,7 @@
pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
QSelf {
lt_token: _i . lt_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
position: _i . position,
as_token: _i . as_token,
gt_token: _i . gt_token,
@@ -2179,9 +2179,9 @@
use ::ReturnType::*;
match _i {
Default => { Default }
- Ty(_binding_0, _binding_1, ) => {
- Ty (
- _visitor.fold_ty(_binding_0),
+ Type(_binding_0, _binding_1, ) => {
+ Type (
+ _visitor.fold_type(_binding_0),
_binding_1,
)
}
@@ -2264,7 +2264,7 @@
const_token: _i . const_token,
ident: _i . ident,
colon_token: _i . colon_token,
- ty: _visitor.fold_ty(_i . ty),
+ ty: _visitor.fold_type(_i . ty),
default: _i . default,
semi_token: _i . semi_token,
}
@@ -2292,78 +2292,78 @@
type_token: _i . type_token,
ident: _i . ident,
colon_token: _i . colon_token,
- bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_ty_param_bound(it) }),
+ bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
default: _i . default,
semi_token: _i . semi_token,
}
}
-pub fn fold_ty<V: Folder + ?Sized>(_visitor: &mut V, _i: Ty) -> Ty {
- use ::Ty::*;
+pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
+ use ::Type::*;
match _i {
Slice(_binding_0, ) => {
Slice (
- _visitor.fold_ty_slice(_binding_0),
+ _visitor.fold_type_slice(_binding_0),
)
}
Array(_binding_0, ) => {
Array (
- _visitor.fold_ty_array(_binding_0),
+ _visitor.fold_type_array(_binding_0),
)
}
Ptr(_binding_0, ) => {
Ptr (
- _visitor.fold_ty_ptr(_binding_0),
+ _visitor.fold_type_ptr(_binding_0),
)
}
Rptr(_binding_0, ) => {
Rptr (
- _visitor.fold_ty_rptr(_binding_0),
+ _visitor.fold_type_rptr(_binding_0),
)
}
BareFn(_binding_0, ) => {
BareFn (
- _visitor.fold_ty_bare_fn(_binding_0),
+ _visitor.fold_type_bare_fn(_binding_0),
)
}
Never(_binding_0, ) => {
Never (
- _visitor.fold_ty_never(_binding_0),
+ _visitor.fold_type_never(_binding_0),
)
}
Tup(_binding_0, ) => {
Tup (
- _visitor.fold_ty_tup(_binding_0),
+ _visitor.fold_type_tup(_binding_0),
)
}
Path(_binding_0, ) => {
Path (
- _visitor.fold_ty_path(_binding_0),
+ _visitor.fold_type_path(_binding_0),
)
}
TraitObject(_binding_0, ) => {
TraitObject (
- _visitor.fold_ty_trait_object(_binding_0),
+ _visitor.fold_type_trait_object(_binding_0),
)
}
ImplTrait(_binding_0, ) => {
ImplTrait (
- _visitor.fold_ty_impl_trait(_binding_0),
+ _visitor.fold_type_impl_trait(_binding_0),
)
}
Paren(_binding_0, ) => {
Paren (
- _visitor.fold_ty_paren(_binding_0),
+ _visitor.fold_type_paren(_binding_0),
)
}
Group(_binding_0, ) => {
Group (
- _visitor.fold_ty_group(_binding_0),
+ _visitor.fold_type_group(_binding_0),
)
}
Infer(_binding_0, ) => {
Infer (
- _visitor.fold_ty_infer(_binding_0),
+ _visitor.fold_type_infer(_binding_0),
)
}
Macro(_binding_0, ) => {
@@ -2374,60 +2374,68 @@
}
}
-pub fn fold_ty_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TyArray) -> TyArray {
- TyArray {
+pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
+ TypeArray {
bracket_token: _i . bracket_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
semi_token: _i . semi_token,
amt: _visitor.fold_expr(_i . amt),
}
}
-pub fn fold_ty_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TyBareFn) -> TyBareFn {
- TyBareFn {
- ty: Box::new(_visitor.fold_bare_fn_ty(* _i . ty)),
+pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
+ TypeBareFn {
+ ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
}
}
-pub fn fold_ty_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TyGroup) -> TyGroup {
- TyGroup {
+pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
+ TypeBinding {
+ ident: _i . ident,
+ eq_token: _i . eq_token,
+ ty: _visitor.fold_type(_i . ty),
+ }
+}
+
+pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
+ TypeGroup {
group_token: _i . group_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
}
}
-pub fn fold_ty_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TyImplTrait) -> TyImplTrait {
- TyImplTrait {
+pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
+ TypeImplTrait {
impl_token: _i . impl_token,
- bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_ty_param_bound(it) }),
+ bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
}
}
-pub fn fold_ty_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TyInfer) -> TyInfer {
- TyInfer {
+pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
+ TypeInfer {
underscore_token: _i . underscore_token,
}
}
-pub fn fold_ty_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TyNever) -> TyNever {
- TyNever {
+pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
+ TypeNever {
bang_token: _i . bang_token,
}
}
-pub fn fold_ty_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TyParam) -> TyParam {
- TyParam {
+pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
+ TypeParam {
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
ident: _i . ident,
colon_token: _i . colon_token,
- bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_ty_param_bound(it) }),
+ bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
eq_token: _i . eq_token,
- default: (_i . default).map(|it| { _visitor.fold_ty(it) }),
+ default: (_i . default).map(|it| { _visitor.fold_type(it) }),
}
}
-pub fn fold_ty_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TyParamBound) -> TyParamBound {
- use ::TyParamBound::*;
+pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
+ use ::TypeParamBound::*;
match _i {
Trait(_binding_0, _binding_1, ) => {
Trait (
@@ -2443,65 +2451,57 @@
}
}
-pub fn fold_ty_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TyParen) -> TyParen {
- TyParen {
+pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
+ TypeParen {
paren_token: _i . paren_token,
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
}
}
-pub fn fold_ty_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TyPath) -> TyPath {
- TyPath {
+pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
+ TypePath {
qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
path: _visitor.fold_path(_i . path),
}
}
-pub fn fold_ty_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TyPtr) -> TyPtr {
- TyPtr {
+pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
+ TypePtr {
star_token: _i . star_token,
const_token: _i . const_token,
- ty: Box::new(_visitor.fold_mut_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
}
}
-pub fn fold_ty_rptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TyRptr) -> TyRptr {
- TyRptr {
+pub fn fold_type_rptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeRptr) -> TypeRptr {
+ TypeRptr {
and_token: _i . and_token,
lifetime: _i . lifetime,
- ty: Box::new(_visitor.fold_mut_ty(* _i . ty)),
+ ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
}
}
-pub fn fold_ty_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TySlice) -> TySlice {
- TySlice {
- ty: Box::new(_visitor.fold_ty(* _i . ty)),
+pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
+ TypeSlice {
+ ty: Box::new(_visitor.fold_type(* _i . ty)),
bracket_token: _i . bracket_token,
}
}
-pub fn fold_ty_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TyTraitObject) -> TyTraitObject {
- TyTraitObject {
- bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_ty_param_bound(it) }),
+pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
+ TypeTraitObject {
+ bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
}
}
-pub fn fold_ty_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TyTup) -> TyTup {
- TyTup {
+pub fn fold_type_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTup) -> TypeTup {
+ TypeTup {
paren_token: _i . paren_token,
- tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_ty(it) }),
+ tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
lone_comma: _i . lone_comma,
}
}
-pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
- TypeBinding {
- ident: _i . ident,
- eq_token: _i . eq_token,
- ty: _visitor.fold_ty(_i . ty),
- }
-}
-
pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
use ::UnOp::*;
match _i {
@@ -2642,9 +2642,9 @@
pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
WhereBoundPredicate {
bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
- bounded_ty: _visitor.fold_ty(_i . bounded_ty),
+ bounded_ty: _visitor.fold_type(_i . bounded_ty),
colon_token: _i . colon_token,
- bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_ty_param_bound(it) }),
+ bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
}
}
@@ -2657,9 +2657,9 @@
pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
WhereEqPredicate {
- lhs_ty: _visitor.fold_ty(_i . lhs_ty),
+ lhs_ty: _visitor.fold_type(_i . lhs_ty),
eq_token: _i . eq_token,
- rhs_ty: _visitor.fold_ty(_i . rhs_ty),
+ rhs_ty: _visitor.fold_type(_i . rhs_ty),
}
}
diff --git a/src/gen/visit.rs b/src/gen/visit.rs
index 2d8969b..3e52f7c 100644
--- a/src/gen/visit.rs
+++ b/src/gen/visit.rs
@@ -53,7 +53,7 @@
fn visit_bare_fn_arg_name(&mut self, i: &BareFnArgName) { visit_bare_fn_arg_name(self, i) }
-fn visit_bare_fn_ty(&mut self, i: &BareFnTy) { visit_bare_fn_ty(self, i) }
+fn visit_bare_fn_type(&mut self, i: &BareFnType) { visit_bare_fn_type(self, i) }
fn visit_bin_op(&mut self, i: &BinOp) { visit_bin_op(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -215,7 +215,7 @@
# [ cfg ( feature = "full" ) ]
fn visit_item_trait(&mut self, i: &ItemTrait) { visit_item_trait(self, i) }
# [ cfg ( feature = "full" ) ]
-fn visit_item_ty(&mut self, i: &ItemTy) { visit_item_ty(self, i) }
+fn visit_item_type(&mut self, i: &ItemType) { visit_item_type(self, i) }
# [ cfg ( feature = "full" ) ]
fn visit_item_union(&mut self, i: &ItemUnion) { visit_item_union(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -237,7 +237,7 @@
# [ cfg ( feature = "full" ) ]
fn visit_method_sig(&mut self, i: &MethodSig) { visit_method_sig(self, i) }
-fn visit_mut_ty(&mut self, i: &MutTy) { visit_mut_ty(self, i) }
+fn visit_mut_type(&mut self, i: &MutType) { visit_mut_type(self, i) }
fn visit_mutability(&mut self, i: &Mutability) { visit_mutability(self, i) }
@@ -305,40 +305,40 @@
# [ cfg ( feature = "full" ) ]
fn visit_trait_item_type(&mut self, i: &TraitItemType) { visit_trait_item_type(self, i) }
-fn visit_ty(&mut self, i: &Ty) { visit_ty(self, i) }
+fn visit_type(&mut self, i: &Type) { visit_type(self, i) }
-fn visit_ty_array(&mut self, i: &TyArray) { visit_ty_array(self, i) }
+fn visit_type_array(&mut self, i: &TypeArray) { visit_type_array(self, i) }
-fn visit_ty_bare_fn(&mut self, i: &TyBareFn) { visit_ty_bare_fn(self, i) }
-
-fn visit_ty_group(&mut self, i: &TyGroup) { visit_ty_group(self, i) }
-
-fn visit_ty_impl_trait(&mut self, i: &TyImplTrait) { visit_ty_impl_trait(self, i) }
-
-fn visit_ty_infer(&mut self, i: &TyInfer) { visit_ty_infer(self, i) }
-
-fn visit_ty_never(&mut self, i: &TyNever) { visit_ty_never(self, i) }
-
-fn visit_ty_param(&mut self, i: &TyParam) { visit_ty_param(self, i) }
-
-fn visit_ty_param_bound(&mut self, i: &TyParamBound) { visit_ty_param_bound(self, i) }
-
-fn visit_ty_paren(&mut self, i: &TyParen) { visit_ty_paren(self, i) }
-
-fn visit_ty_path(&mut self, i: &TyPath) { visit_ty_path(self, i) }
-
-fn visit_ty_ptr(&mut self, i: &TyPtr) { visit_ty_ptr(self, i) }
-
-fn visit_ty_rptr(&mut self, i: &TyRptr) { visit_ty_rptr(self, i) }
-
-fn visit_ty_slice(&mut self, i: &TySlice) { visit_ty_slice(self, i) }
-
-fn visit_ty_trait_object(&mut self, i: &TyTraitObject) { visit_ty_trait_object(self, i) }
-
-fn visit_ty_tup(&mut self, i: &TyTup) { visit_ty_tup(self, i) }
+fn visit_type_bare_fn(&mut self, i: &TypeBareFn) { visit_type_bare_fn(self, i) }
fn visit_type_binding(&mut self, i: &TypeBinding) { visit_type_binding(self, i) }
+fn visit_type_group(&mut self, i: &TypeGroup) { visit_type_group(self, i) }
+
+fn visit_type_impl_trait(&mut self, i: &TypeImplTrait) { visit_type_impl_trait(self, i) }
+
+fn visit_type_infer(&mut self, i: &TypeInfer) { visit_type_infer(self, i) }
+
+fn visit_type_never(&mut self, i: &TypeNever) { visit_type_never(self, i) }
+
+fn visit_type_param(&mut self, i: &TypeParam) { visit_type_param(self, i) }
+
+fn visit_type_param_bound(&mut self, i: &TypeParamBound) { visit_type_param_bound(self, i) }
+
+fn visit_type_paren(&mut self, i: &TypeParen) { visit_type_paren(self, i) }
+
+fn visit_type_path(&mut self, i: &TypePath) { visit_type_path(self, i) }
+
+fn visit_type_ptr(&mut self, i: &TypePtr) { visit_type_ptr(self, i) }
+
+fn visit_type_rptr(&mut self, i: &TypeRptr) { visit_type_rptr(self, i) }
+
+fn visit_type_slice(&mut self, i: &TypeSlice) { visit_type_slice(self, i) }
+
+fn visit_type_trait_object(&mut self, i: &TypeTraitObject) { visit_type_trait_object(self, i) }
+
+fn visit_type_tup(&mut self, i: &TypeTup) { visit_type_tup(self, i) }
+
fn visit_un_op(&mut self, i: &UnOp) { visit_un_op(self, i) }
fn visit_unsafety(&mut self, i: &Unsafety) { visit_unsafety(self, i) }
@@ -391,7 +391,7 @@
// Skipped field _i . turbofish;
// Skipped field _i . lt_token;
// Skipped field _i . lifetimes;
- for el in (_i . types).iter() { let it = el.item(); _visitor.visit_ty(&it) };
+ for el in (_i . types).iter() { let it = el.item(); _visitor.visit_type(&it) };
for el in (_i . bindings).iter() { let it = el.item(); _visitor.visit_type_binding(&it) };
// Skipped field _i . gt_token;
}
@@ -399,7 +399,7 @@
pub fn visit_arg_captured<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ArgCaptured) {
_visitor.visit_pat(&_i . pat);
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
}
# [ cfg ( feature = "full" ) ]
pub fn visit_arg_self<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ArgSelf) {
@@ -445,7 +445,7 @@
pub fn visit_bare_fn_arg<V: Visitor + ?Sized>(_visitor: &mut V, _i: &BareFnArg) {
// Skipped field _i . name;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
}
pub fn visit_bare_fn_arg_name<V: Visitor + ?Sized>(_visitor: &mut V, _i: &BareFnArgName) {
@@ -460,7 +460,7 @@
}
}
-pub fn visit_bare_fn_ty<V: Visitor + ?Sized>(_visitor: &mut V, _i: &BareFnTy) {
+pub fn visit_bare_fn_type<V: Visitor + ?Sized>(_visitor: &mut V, _i: &BareFnType) {
if let Some(ref it) = _i . lifetimes { _visitor.visit_bound_lifetimes(&* it) };
_visitor.visit_unsafety(&_i . unsafety);
if let Some(ref it) = _i . abi { _visitor.visit_abi(&* it) };
@@ -707,7 +707,7 @@
pub fn visit_expr_cast<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ExprCast) {
_visitor.visit_expr(&_i . expr);
// Skipped field _i . as_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
}
# [ cfg ( feature = "full" ) ]
pub fn visit_expr_catch<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ExprCatch) {
@@ -921,7 +921,7 @@
pub fn visit_expr_method_call<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ExprMethodCall) {
_visitor.visit_expr(&_i . expr);
// Skipped field _i . method;
- for el in (_i . typarams).iter() { let it = el.item(); _visitor.visit_ty(&it) };
+ for el in (_i . typarams).iter() { let it = el.item(); _visitor.visit_type(&it) };
for el in (_i . args).iter() { let it = el.item(); _visitor.visit_expr(&it) };
// Skipped field _i . paren_token;
// Skipped field _i . dot_token;
@@ -986,7 +986,7 @@
pub fn visit_expr_type<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ExprType) {
_visitor.visit_expr(&_i . expr);
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
}
pub fn visit_expr_unary<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ExprUnary) {
@@ -1022,7 +1022,7 @@
// Skipped field _i . ident;
_visitor.visit_visibility(&_i . vis);
for it in (_i . attrs).iter() { _visitor.visit_attribute(&it) };
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . colon_token;
}
# [ cfg ( feature = "full" ) ]
@@ -1061,7 +1061,7 @@
_visitor.visit_arg_captured(&* _binding_0);
}
Ignored(ref _binding_0, ) => {
- _visitor.visit_ty(&* _binding_0);
+ _visitor.visit_type(&* _binding_0);
}
}
}
@@ -1103,7 +1103,7 @@
_visitor.visit_mutability(&_i . mutbl);
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . semi_token;
}
@@ -1111,7 +1111,7 @@
// Skipped field _i . lt_token;
// Skipped field _i . gt_token;
for el in (_i . lifetimes).iter() { let it = el.item(); _visitor.visit_lifetime_def(&it) };
- for el in (_i . ty_params).iter() { let it = el.item(); _visitor.visit_ty_param(&it) };
+ for el in (_i . ty_params).iter() { let it = el.item(); _visitor.visit_type_param(&it) };
_visitor.visit_where_clause(&_i . where_clause);
}
# [ cfg ( feature = "full" ) ]
@@ -1140,7 +1140,7 @@
// Skipped field _i . const_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . eq_token;
_visitor.visit_expr(&_i . expr);
// Skipped field _i . semi_token;
@@ -1166,7 +1166,7 @@
// Skipped field _i . type_token;
// Skipped field _i . ident;
// Skipped field _i . eq_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . semi_token;
}
# [ cfg ( feature = "full" ) ]
@@ -1216,8 +1216,8 @@
ForeignMod(ref _binding_0, ) => {
_visitor.visit_item_foreign_mod(&* _binding_0);
}
- Ty(ref _binding_0, ) => {
- _visitor.visit_item_ty(&* _binding_0);
+ Type(ref _binding_0, ) => {
+ _visitor.visit_item_type(&* _binding_0);
}
Enum(ref _binding_0, ) => {
_visitor.visit_item_enum(&* _binding_0);
@@ -1249,7 +1249,7 @@
// Skipped field _i . const_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . eq_token;
_visitor.visit_expr(&_i . expr);
// Skipped field _i . semi_token;
@@ -1310,7 +1310,7 @@
// Skipped field _i . impl_token;
_visitor.visit_generics(&_i . generics);
// Skipped field _i . trait_;
- _visitor.visit_ty(&_i . self_ty);
+ _visitor.visit_type(&_i . self_ty);
// Skipped field _i . brace_token;
for it in (_i . items).iter() { _visitor.visit_impl_item(&it) };
}
@@ -1337,7 +1337,7 @@
_visitor.visit_mutability(&_i . mutbl);
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . eq_token;
_visitor.visit_expr(&_i . expr);
// Skipped field _i . semi_token;
@@ -1361,19 +1361,19 @@
// Skipped field _i . ident;
_visitor.visit_generics(&_i . generics);
// Skipped field _i . colon_token;
- for el in (_i . supertraits).iter() { let it = el.item(); _visitor.visit_ty_param_bound(&it) };
+ for el in (_i . supertraits).iter() { let it = el.item(); _visitor.visit_type_param_bound(&it) };
// Skipped field _i . brace_token;
for it in (_i . items).iter() { _visitor.visit_trait_item(&it) };
}
# [ cfg ( feature = "full" ) ]
-pub fn visit_item_ty<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ItemTy) {
+pub fn visit_item_type<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ItemType) {
for it in (_i . attrs).iter() { _visitor.visit_attribute(&it) };
_visitor.visit_visibility(&_i . vis);
// Skipped field _i . type_token;
// Skipped field _i . ident;
_visitor.visit_generics(&_i . generics);
// Skipped field _i . eq_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . semi_token;
}
# [ cfg ( feature = "full" ) ]
@@ -1407,7 +1407,7 @@
// Skipped field _i . eq_token;
// Skipped field _i . semi_token;
_visitor.visit_pat(&_i . pat);
- if let Some(ref it) = _i . ty { _visitor.visit_ty(&* it) };
+ if let Some(ref it) = _i . ty { _visitor.visit_type(&* it) };
if let Some(ref it) = _i . init { _visitor.visit_expr(&* it) };
for it in (_i . attrs).iter() { _visitor.visit_attribute(&it) };
}
@@ -1464,8 +1464,8 @@
_visitor.visit_fn_decl(&_i . decl);
}
-pub fn visit_mut_ty<V: Visitor + ?Sized>(_visitor: &mut V, _i: &MutTy) {
- _visitor.visit_ty(&_i . ty);
+pub fn visit_mut_type<V: Visitor + ?Sized>(_visitor: &mut V, _i: &MutType) {
+ _visitor.visit_type(&_i . ty);
_visitor.visit_mutability(&_i . mutability);
}
@@ -1493,7 +1493,7 @@
pub fn visit_parenthesized_parameter_data<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ParenthesizedParameterData) {
// Skipped field _i . paren_token;
- for el in (_i . inputs).iter() { let it = el.item(); _visitor.visit_ty(&it) };
+ for el in (_i . inputs).iter() { let it = el.item(); _visitor.visit_type(&it) };
_visitor.visit_return_type(&_i . output);
}
# [ cfg ( feature = "full" ) ]
@@ -1660,7 +1660,7 @@
pub fn visit_qself<V: Visitor + ?Sized>(_visitor: &mut V, _i: &QSelf) {
// Skipped field _i . lt_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . position;
// Skipped field _i . as_token;
// Skipped field _i . gt_token;
@@ -1682,8 +1682,8 @@
use ::ReturnType::*;
match *_i {
Default => { }
- Ty(ref _binding_0, ref _binding_1, ) => {
- _visitor.visit_ty(&* _binding_0);
+ Type(ref _binding_0, ref _binding_1, ) => {
+ _visitor.visit_type(&* _binding_0);
// Skipped field * _binding_1;
}
}
@@ -1744,7 +1744,7 @@
// Skipped field _i . const_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . default;
// Skipped field _i . semi_token;
}
@@ -1766,52 +1766,52 @@
// Skipped field _i . type_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_ty_param_bound(&it) };
+ for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_type_param_bound(&it) };
// Skipped field _i . default;
// Skipped field _i . semi_token;
}
-pub fn visit_ty<V: Visitor + ?Sized>(_visitor: &mut V, _i: &Ty) {
- use ::Ty::*;
+pub fn visit_type<V: Visitor + ?Sized>(_visitor: &mut V, _i: &Type) {
+ use ::Type::*;
match *_i {
Slice(ref _binding_0, ) => {
- _visitor.visit_ty_slice(&* _binding_0);
+ _visitor.visit_type_slice(&* _binding_0);
}
Array(ref _binding_0, ) => {
- _visitor.visit_ty_array(&* _binding_0);
+ _visitor.visit_type_array(&* _binding_0);
}
Ptr(ref _binding_0, ) => {
- _visitor.visit_ty_ptr(&* _binding_0);
+ _visitor.visit_type_ptr(&* _binding_0);
}
Rptr(ref _binding_0, ) => {
- _visitor.visit_ty_rptr(&* _binding_0);
+ _visitor.visit_type_rptr(&* _binding_0);
}
BareFn(ref _binding_0, ) => {
- _visitor.visit_ty_bare_fn(&* _binding_0);
+ _visitor.visit_type_bare_fn(&* _binding_0);
}
Never(ref _binding_0, ) => {
- _visitor.visit_ty_never(&* _binding_0);
+ _visitor.visit_type_never(&* _binding_0);
}
Tup(ref _binding_0, ) => {
- _visitor.visit_ty_tup(&* _binding_0);
+ _visitor.visit_type_tup(&* _binding_0);
}
Path(ref _binding_0, ) => {
- _visitor.visit_ty_path(&* _binding_0);
+ _visitor.visit_type_path(&* _binding_0);
}
TraitObject(ref _binding_0, ) => {
- _visitor.visit_ty_trait_object(&* _binding_0);
+ _visitor.visit_type_trait_object(&* _binding_0);
}
ImplTrait(ref _binding_0, ) => {
- _visitor.visit_ty_impl_trait(&* _binding_0);
+ _visitor.visit_type_impl_trait(&* _binding_0);
}
Paren(ref _binding_0, ) => {
- _visitor.visit_ty_paren(&* _binding_0);
+ _visitor.visit_type_paren(&* _binding_0);
}
Group(ref _binding_0, ) => {
- _visitor.visit_ty_group(&* _binding_0);
+ _visitor.visit_type_group(&* _binding_0);
}
Infer(ref _binding_0, ) => {
- _visitor.visit_ty_infer(&* _binding_0);
+ _visitor.visit_type_infer(&* _binding_0);
}
Macro(ref _binding_0, ) => {
_visitor.visit_macro(&* _binding_0);
@@ -1819,46 +1819,52 @@
}
}
-pub fn visit_ty_array<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyArray) {
+pub fn visit_type_array<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeArray) {
// Skipped field _i . bracket_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . semi_token;
_visitor.visit_expr(&_i . amt);
}
-pub fn visit_ty_bare_fn<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyBareFn) {
- _visitor.visit_bare_fn_ty(&_i . ty);
+pub fn visit_type_bare_fn<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeBareFn) {
+ _visitor.visit_bare_fn_type(&_i . ty);
}
-pub fn visit_ty_group<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyGroup) {
+pub fn visit_type_binding<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeBinding) {
+ // Skipped field _i . ident;
+ // Skipped field _i . eq_token;
+ _visitor.visit_type(&_i . ty);
+}
+
+pub fn visit_type_group<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeGroup) {
// Skipped field _i . group_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
}
-pub fn visit_ty_impl_trait<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyImplTrait) {
+pub fn visit_type_impl_trait<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeImplTrait) {
// Skipped field _i . impl_token;
- for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_ty_param_bound(&it) };
+ for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_type_param_bound(&it) };
}
-pub fn visit_ty_infer<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyInfer) {
+pub fn visit_type_infer<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeInfer) {
// Skipped field _i . underscore_token;
}
-pub fn visit_ty_never<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyNever) {
+pub fn visit_type_never<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeNever) {
// Skipped field _i . bang_token;
}
-pub fn visit_ty_param<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyParam) {
+pub fn visit_type_param<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeParam) {
for it in (_i . attrs).iter() { _visitor.visit_attribute(&it) };
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_ty_param_bound(&it) };
+ for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_type_param_bound(&it) };
// Skipped field _i . eq_token;
- if let Some(ref it) = _i . default { _visitor.visit_ty(&* it) };
+ if let Some(ref it) = _i . default { _visitor.visit_type(&* it) };
}
-pub fn visit_ty_param_bound<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyParamBound) {
- use ::TyParamBound::*;
+pub fn visit_type_param_bound<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeParamBound) {
+ use ::TypeParamBound::*;
match *_i {
Trait(ref _binding_0, ref _binding_1, ) => {
_visitor.visit_poly_trait_ref(&* _binding_0);
@@ -1870,49 +1876,43 @@
}
}
-pub fn visit_ty_paren<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyParen) {
+pub fn visit_type_paren<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeParen) {
// Skipped field _i . paren_token;
- _visitor.visit_ty(&_i . ty);
+ _visitor.visit_type(&_i . ty);
}
-pub fn visit_ty_path<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyPath) {
+pub fn visit_type_path<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypePath) {
if let Some(ref it) = _i . qself { _visitor.visit_qself(&* it) };
_visitor.visit_path(&_i . path);
}
-pub fn visit_ty_ptr<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyPtr) {
+pub fn visit_type_ptr<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypePtr) {
// Skipped field _i . star_token;
// Skipped field _i . const_token;
- _visitor.visit_mut_ty(&_i . ty);
+ _visitor.visit_mut_type(&_i . ty);
}
-pub fn visit_ty_rptr<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyRptr) {
+pub fn visit_type_rptr<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeRptr) {
// Skipped field _i . and_token;
// Skipped field _i . lifetime;
- _visitor.visit_mut_ty(&_i . ty);
+ _visitor.visit_mut_type(&_i . ty);
}
-pub fn visit_ty_slice<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TySlice) {
- _visitor.visit_ty(&_i . ty);
+pub fn visit_type_slice<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeSlice) {
+ _visitor.visit_type(&_i . ty);
// Skipped field _i . bracket_token;
}
-pub fn visit_ty_trait_object<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyTraitObject) {
- for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_ty_param_bound(&it) };
+pub fn visit_type_trait_object<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeTraitObject) {
+ for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_type_param_bound(&it) };
}
-pub fn visit_ty_tup<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TyTup) {
+pub fn visit_type_tup<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeTup) {
// Skipped field _i . paren_token;
- for el in (_i . tys).iter() { let it = el.item(); _visitor.visit_ty(&it) };
+ for el in (_i . tys).iter() { let it = el.item(); _visitor.visit_type(&it) };
// Skipped field _i . lone_comma;
}
-pub fn visit_type_binding<V: Visitor + ?Sized>(_visitor: &mut V, _i: &TypeBinding) {
- // Skipped field _i . ident;
- // Skipped field _i . eq_token;
- _visitor.visit_ty(&_i . ty);
-}
-
pub fn visit_un_op<V: Visitor + ?Sized>(_visitor: &mut V, _i: &UnOp) {
use ::UnOp::*;
match *_i {
@@ -2016,9 +2016,9 @@
pub fn visit_where_bound_predicate<V: Visitor + ?Sized>(_visitor: &mut V, _i: &WhereBoundPredicate) {
if let Some(ref it) = _i . bound_lifetimes { _visitor.visit_bound_lifetimes(&* it) };
- _visitor.visit_ty(&_i . bounded_ty);
+ _visitor.visit_type(&_i . bounded_ty);
// Skipped field _i . colon_token;
- for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_ty_param_bound(&it) };
+ for el in (_i . bounds).iter() { let it = el.item(); _visitor.visit_type_param_bound(&it) };
}
pub fn visit_where_clause<V: Visitor + ?Sized>(_visitor: &mut V, _i: &WhereClause) {
@@ -2027,9 +2027,9 @@
}
pub fn visit_where_eq_predicate<V: Visitor + ?Sized>(_visitor: &mut V, _i: &WhereEqPredicate) {
- _visitor.visit_ty(&_i . lhs_ty);
+ _visitor.visit_type(&_i . lhs_ty);
// Skipped field _i . eq_token;
- _visitor.visit_ty(&_i . rhs_ty);
+ _visitor.visit_type(&_i . rhs_ty);
}
pub fn visit_where_predicate<V: Visitor + ?Sized>(_visitor: &mut V, _i: &WherePredicate) {
diff --git a/src/gen/visit_mut.rs b/src/gen/visit_mut.rs
index 838c48f..e35470a 100644
--- a/src/gen/visit_mut.rs
+++ b/src/gen/visit_mut.rs
@@ -53,7 +53,7 @@
fn visit_bare_fn_arg_name_mut(&mut self, i: &mut BareFnArgName) { visit_bare_fn_arg_name_mut(self, i) }
-fn visit_bare_fn_ty_mut(&mut self, i: &mut BareFnTy) { visit_bare_fn_ty_mut(self, i) }
+fn visit_bare_fn_type_mut(&mut self, i: &mut BareFnType) { visit_bare_fn_type_mut(self, i) }
fn visit_bin_op_mut(&mut self, i: &mut BinOp) { visit_bin_op_mut(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -215,7 +215,7 @@
# [ cfg ( feature = "full" ) ]
fn visit_item_trait_mut(&mut self, i: &mut ItemTrait) { visit_item_trait_mut(self, i) }
# [ cfg ( feature = "full" ) ]
-fn visit_item_ty_mut(&mut self, i: &mut ItemTy) { visit_item_ty_mut(self, i) }
+fn visit_item_type_mut(&mut self, i: &mut ItemType) { visit_item_type_mut(self, i) }
# [ cfg ( feature = "full" ) ]
fn visit_item_union_mut(&mut self, i: &mut ItemUnion) { visit_item_union_mut(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -237,7 +237,7 @@
# [ cfg ( feature = "full" ) ]
fn visit_method_sig_mut(&mut self, i: &mut MethodSig) { visit_method_sig_mut(self, i) }
-fn visit_mut_ty_mut(&mut self, i: &mut MutTy) { visit_mut_ty_mut(self, i) }
+fn visit_mut_type_mut(&mut self, i: &mut MutType) { visit_mut_type_mut(self, i) }
fn visit_mutability_mut(&mut self, i: &mut Mutability) { visit_mutability_mut(self, i) }
@@ -305,40 +305,40 @@
# [ cfg ( feature = "full" ) ]
fn visit_trait_item_type_mut(&mut self, i: &mut TraitItemType) { visit_trait_item_type_mut(self, i) }
-fn visit_ty_mut(&mut self, i: &mut Ty) { visit_ty_mut(self, i) }
+fn visit_type_mut(&mut self, i: &mut Type) { visit_type_mut(self, i) }
-fn visit_ty_array_mut(&mut self, i: &mut TyArray) { visit_ty_array_mut(self, i) }
+fn visit_type_array_mut(&mut self, i: &mut TypeArray) { visit_type_array_mut(self, i) }
-fn visit_ty_bare_fn_mut(&mut self, i: &mut TyBareFn) { visit_ty_bare_fn_mut(self, i) }
-
-fn visit_ty_group_mut(&mut self, i: &mut TyGroup) { visit_ty_group_mut(self, i) }
-
-fn visit_ty_impl_trait_mut(&mut self, i: &mut TyImplTrait) { visit_ty_impl_trait_mut(self, i) }
-
-fn visit_ty_infer_mut(&mut self, i: &mut TyInfer) { visit_ty_infer_mut(self, i) }
-
-fn visit_ty_never_mut(&mut self, i: &mut TyNever) { visit_ty_never_mut(self, i) }
-
-fn visit_ty_param_mut(&mut self, i: &mut TyParam) { visit_ty_param_mut(self, i) }
-
-fn visit_ty_param_bound_mut(&mut self, i: &mut TyParamBound) { visit_ty_param_bound_mut(self, i) }
-
-fn visit_ty_paren_mut(&mut self, i: &mut TyParen) { visit_ty_paren_mut(self, i) }
-
-fn visit_ty_path_mut(&mut self, i: &mut TyPath) { visit_ty_path_mut(self, i) }
-
-fn visit_ty_ptr_mut(&mut self, i: &mut TyPtr) { visit_ty_ptr_mut(self, i) }
-
-fn visit_ty_rptr_mut(&mut self, i: &mut TyRptr) { visit_ty_rptr_mut(self, i) }
-
-fn visit_ty_slice_mut(&mut self, i: &mut TySlice) { visit_ty_slice_mut(self, i) }
-
-fn visit_ty_trait_object_mut(&mut self, i: &mut TyTraitObject) { visit_ty_trait_object_mut(self, i) }
-
-fn visit_ty_tup_mut(&mut self, i: &mut TyTup) { visit_ty_tup_mut(self, i) }
+fn visit_type_bare_fn_mut(&mut self, i: &mut TypeBareFn) { visit_type_bare_fn_mut(self, i) }
fn visit_type_binding_mut(&mut self, i: &mut TypeBinding) { visit_type_binding_mut(self, i) }
+fn visit_type_group_mut(&mut self, i: &mut TypeGroup) { visit_type_group_mut(self, i) }
+
+fn visit_type_impl_trait_mut(&mut self, i: &mut TypeImplTrait) { visit_type_impl_trait_mut(self, i) }
+
+fn visit_type_infer_mut(&mut self, i: &mut TypeInfer) { visit_type_infer_mut(self, i) }
+
+fn visit_type_never_mut(&mut self, i: &mut TypeNever) { visit_type_never_mut(self, i) }
+
+fn visit_type_param_mut(&mut self, i: &mut TypeParam) { visit_type_param_mut(self, i) }
+
+fn visit_type_param_bound_mut(&mut self, i: &mut TypeParamBound) { visit_type_param_bound_mut(self, i) }
+
+fn visit_type_paren_mut(&mut self, i: &mut TypeParen) { visit_type_paren_mut(self, i) }
+
+fn visit_type_path_mut(&mut self, i: &mut TypePath) { visit_type_path_mut(self, i) }
+
+fn visit_type_ptr_mut(&mut self, i: &mut TypePtr) { visit_type_ptr_mut(self, i) }
+
+fn visit_type_rptr_mut(&mut self, i: &mut TypeRptr) { visit_type_rptr_mut(self, i) }
+
+fn visit_type_slice_mut(&mut self, i: &mut TypeSlice) { visit_type_slice_mut(self, i) }
+
+fn visit_type_trait_object_mut(&mut self, i: &mut TypeTraitObject) { visit_type_trait_object_mut(self, i) }
+
+fn visit_type_tup_mut(&mut self, i: &mut TypeTup) { visit_type_tup_mut(self, i) }
+
fn visit_un_op_mut(&mut self, i: &mut UnOp) { visit_un_op_mut(self, i) }
fn visit_unsafety_mut(&mut self, i: &mut Unsafety) { visit_unsafety_mut(self, i) }
@@ -391,7 +391,7 @@
// Skipped field _i . turbofish;
// Skipped field _i . lt_token;
// Skipped field _i . lifetimes;
- for mut el in (_i . types).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_mut(&mut it) };
+ for mut el in (_i . types).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_mut(&mut it) };
for mut el in (_i . bindings).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_binding_mut(&mut it) };
// Skipped field _i . gt_token;
}
@@ -399,7 +399,7 @@
pub fn visit_arg_captured_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ArgCaptured) {
_visitor.visit_pat_mut(&mut _i . pat);
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
}
# [ cfg ( feature = "full" ) ]
pub fn visit_arg_self_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ArgSelf) {
@@ -445,7 +445,7 @@
pub fn visit_bare_fn_arg_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut BareFnArg) {
// Skipped field _i . name;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
}
pub fn visit_bare_fn_arg_name_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut BareFnArgName) {
@@ -460,7 +460,7 @@
}
}
-pub fn visit_bare_fn_ty_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut BareFnTy) {
+pub fn visit_bare_fn_type_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut BareFnType) {
if let Some(ref mut it) = _i . lifetimes { _visitor.visit_bound_lifetimes_mut(&mut * it) };
_visitor.visit_unsafety_mut(&mut _i . unsafety);
if let Some(ref mut it) = _i . abi { _visitor.visit_abi_mut(&mut * it) };
@@ -707,7 +707,7 @@
pub fn visit_expr_cast_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ExprCast) {
_visitor.visit_expr_mut(&mut _i . expr);
// Skipped field _i . as_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
}
# [ cfg ( feature = "full" ) ]
pub fn visit_expr_catch_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ExprCatch) {
@@ -921,7 +921,7 @@
pub fn visit_expr_method_call_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ExprMethodCall) {
_visitor.visit_expr_mut(&mut _i . expr);
// Skipped field _i . method;
- for mut el in (_i . typarams).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_mut(&mut it) };
+ for mut el in (_i . typarams).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_mut(&mut it) };
for mut el in (_i . args).iter_mut() { let mut it = el.item_mut(); _visitor.visit_expr_mut(&mut it) };
// Skipped field _i . paren_token;
// Skipped field _i . dot_token;
@@ -986,7 +986,7 @@
pub fn visit_expr_type_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ExprType) {
_visitor.visit_expr_mut(&mut _i . expr);
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
}
pub fn visit_expr_unary_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ExprUnary) {
@@ -1022,7 +1022,7 @@
// Skipped field _i . ident;
_visitor.visit_visibility_mut(&mut _i . vis);
for mut it in (_i . attrs).iter_mut() { _visitor.visit_attribute_mut(&mut it) };
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . colon_token;
}
# [ cfg ( feature = "full" ) ]
@@ -1061,7 +1061,7 @@
_visitor.visit_arg_captured_mut(&mut * _binding_0);
}
Ignored(ref mut _binding_0, ) => {
- _visitor.visit_ty_mut(&mut * _binding_0);
+ _visitor.visit_type_mut(&mut * _binding_0);
}
}
}
@@ -1103,7 +1103,7 @@
_visitor.visit_mutability_mut(&mut _i . mutbl);
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . semi_token;
}
@@ -1111,7 +1111,7 @@
// Skipped field _i . lt_token;
// Skipped field _i . gt_token;
for mut el in (_i . lifetimes).iter_mut() { let mut it = el.item_mut(); _visitor.visit_lifetime_def_mut(&mut it) };
- for mut el in (_i . ty_params).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_mut(&mut it) };
+ for mut el in (_i . ty_params).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_mut(&mut it) };
_visitor.visit_where_clause_mut(&mut _i . where_clause);
}
# [ cfg ( feature = "full" ) ]
@@ -1140,7 +1140,7 @@
// Skipped field _i . const_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . eq_token;
_visitor.visit_expr_mut(&mut _i . expr);
// Skipped field _i . semi_token;
@@ -1166,7 +1166,7 @@
// Skipped field _i . type_token;
// Skipped field _i . ident;
// Skipped field _i . eq_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . semi_token;
}
# [ cfg ( feature = "full" ) ]
@@ -1216,8 +1216,8 @@
ForeignMod(ref mut _binding_0, ) => {
_visitor.visit_item_foreign_mod_mut(&mut * _binding_0);
}
- Ty(ref mut _binding_0, ) => {
- _visitor.visit_item_ty_mut(&mut * _binding_0);
+ Type(ref mut _binding_0, ) => {
+ _visitor.visit_item_type_mut(&mut * _binding_0);
}
Enum(ref mut _binding_0, ) => {
_visitor.visit_item_enum_mut(&mut * _binding_0);
@@ -1249,7 +1249,7 @@
// Skipped field _i . const_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . eq_token;
_visitor.visit_expr_mut(&mut _i . expr);
// Skipped field _i . semi_token;
@@ -1310,7 +1310,7 @@
// Skipped field _i . impl_token;
_visitor.visit_generics_mut(&mut _i . generics);
// Skipped field _i . trait_;
- _visitor.visit_ty_mut(&mut _i . self_ty);
+ _visitor.visit_type_mut(&mut _i . self_ty);
// Skipped field _i . brace_token;
for mut it in (_i . items).iter_mut() { _visitor.visit_impl_item_mut(&mut it) };
}
@@ -1337,7 +1337,7 @@
_visitor.visit_mutability_mut(&mut _i . mutbl);
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . eq_token;
_visitor.visit_expr_mut(&mut _i . expr);
// Skipped field _i . semi_token;
@@ -1361,19 +1361,19 @@
// Skipped field _i . ident;
_visitor.visit_generics_mut(&mut _i . generics);
// Skipped field _i . colon_token;
- for mut el in (_i . supertraits).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_bound_mut(&mut it) };
+ for mut el in (_i . supertraits).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_bound_mut(&mut it) };
// Skipped field _i . brace_token;
for mut it in (_i . items).iter_mut() { _visitor.visit_trait_item_mut(&mut it) };
}
# [ cfg ( feature = "full" ) ]
-pub fn visit_item_ty_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ItemTy) {
+pub fn visit_item_type_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ItemType) {
for mut it in (_i . attrs).iter_mut() { _visitor.visit_attribute_mut(&mut it) };
_visitor.visit_visibility_mut(&mut _i . vis);
// Skipped field _i . type_token;
// Skipped field _i . ident;
_visitor.visit_generics_mut(&mut _i . generics);
// Skipped field _i . eq_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . semi_token;
}
# [ cfg ( feature = "full" ) ]
@@ -1407,7 +1407,7 @@
// Skipped field _i . eq_token;
// Skipped field _i . semi_token;
_visitor.visit_pat_mut(&mut _i . pat);
- if let Some(ref mut it) = _i . ty { _visitor.visit_ty_mut(&mut * it) };
+ if let Some(ref mut it) = _i . ty { _visitor.visit_type_mut(&mut * it) };
if let Some(ref mut it) = _i . init { _visitor.visit_expr_mut(&mut * it) };
for mut it in (_i . attrs).iter_mut() { _visitor.visit_attribute_mut(&mut it) };
}
@@ -1464,8 +1464,8 @@
_visitor.visit_fn_decl_mut(&mut _i . decl);
}
-pub fn visit_mut_ty_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut MutTy) {
- _visitor.visit_ty_mut(&mut _i . ty);
+pub fn visit_mut_type_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut MutType) {
+ _visitor.visit_type_mut(&mut _i . ty);
_visitor.visit_mutability_mut(&mut _i . mutability);
}
@@ -1493,7 +1493,7 @@
pub fn visit_parenthesized_parameter_data_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut ParenthesizedParameterData) {
// Skipped field _i . paren_token;
- for mut el in (_i . inputs).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_mut(&mut it) };
+ for mut el in (_i . inputs).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_mut(&mut it) };
_visitor.visit_return_type_mut(&mut _i . output);
}
# [ cfg ( feature = "full" ) ]
@@ -1660,7 +1660,7 @@
pub fn visit_qself_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut QSelf) {
// Skipped field _i . lt_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . position;
// Skipped field _i . as_token;
// Skipped field _i . gt_token;
@@ -1682,8 +1682,8 @@
use ::ReturnType::*;
match *_i {
Default => { }
- Ty(ref mut _binding_0, ref mut _binding_1, ) => {
- _visitor.visit_ty_mut(&mut * _binding_0);
+ Type(ref mut _binding_0, ref mut _binding_1, ) => {
+ _visitor.visit_type_mut(&mut * _binding_0);
// Skipped field * _binding_1;
}
}
@@ -1744,7 +1744,7 @@
// Skipped field _i . const_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . default;
// Skipped field _i . semi_token;
}
@@ -1766,52 +1766,52 @@
// Skipped field _i . type_token;
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_bound_mut(&mut it) };
+ for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_bound_mut(&mut it) };
// Skipped field _i . default;
// Skipped field _i . semi_token;
}
-pub fn visit_ty_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut Ty) {
- use ::Ty::*;
+pub fn visit_type_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut Type) {
+ use ::Type::*;
match *_i {
Slice(ref mut _binding_0, ) => {
- _visitor.visit_ty_slice_mut(&mut * _binding_0);
+ _visitor.visit_type_slice_mut(&mut * _binding_0);
}
Array(ref mut _binding_0, ) => {
- _visitor.visit_ty_array_mut(&mut * _binding_0);
+ _visitor.visit_type_array_mut(&mut * _binding_0);
}
Ptr(ref mut _binding_0, ) => {
- _visitor.visit_ty_ptr_mut(&mut * _binding_0);
+ _visitor.visit_type_ptr_mut(&mut * _binding_0);
}
Rptr(ref mut _binding_0, ) => {
- _visitor.visit_ty_rptr_mut(&mut * _binding_0);
+ _visitor.visit_type_rptr_mut(&mut * _binding_0);
}
BareFn(ref mut _binding_0, ) => {
- _visitor.visit_ty_bare_fn_mut(&mut * _binding_0);
+ _visitor.visit_type_bare_fn_mut(&mut * _binding_0);
}
Never(ref mut _binding_0, ) => {
- _visitor.visit_ty_never_mut(&mut * _binding_0);
+ _visitor.visit_type_never_mut(&mut * _binding_0);
}
Tup(ref mut _binding_0, ) => {
- _visitor.visit_ty_tup_mut(&mut * _binding_0);
+ _visitor.visit_type_tup_mut(&mut * _binding_0);
}
Path(ref mut _binding_0, ) => {
- _visitor.visit_ty_path_mut(&mut * _binding_0);
+ _visitor.visit_type_path_mut(&mut * _binding_0);
}
TraitObject(ref mut _binding_0, ) => {
- _visitor.visit_ty_trait_object_mut(&mut * _binding_0);
+ _visitor.visit_type_trait_object_mut(&mut * _binding_0);
}
ImplTrait(ref mut _binding_0, ) => {
- _visitor.visit_ty_impl_trait_mut(&mut * _binding_0);
+ _visitor.visit_type_impl_trait_mut(&mut * _binding_0);
}
Paren(ref mut _binding_0, ) => {
- _visitor.visit_ty_paren_mut(&mut * _binding_0);
+ _visitor.visit_type_paren_mut(&mut * _binding_0);
}
Group(ref mut _binding_0, ) => {
- _visitor.visit_ty_group_mut(&mut * _binding_0);
+ _visitor.visit_type_group_mut(&mut * _binding_0);
}
Infer(ref mut _binding_0, ) => {
- _visitor.visit_ty_infer_mut(&mut * _binding_0);
+ _visitor.visit_type_infer_mut(&mut * _binding_0);
}
Macro(ref mut _binding_0, ) => {
_visitor.visit_macro_mut(&mut * _binding_0);
@@ -1819,46 +1819,52 @@
}
}
-pub fn visit_ty_array_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyArray) {
+pub fn visit_type_array_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeArray) {
// Skipped field _i . bracket_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . semi_token;
_visitor.visit_expr_mut(&mut _i . amt);
}
-pub fn visit_ty_bare_fn_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyBareFn) {
- _visitor.visit_bare_fn_ty_mut(&mut _i . ty);
+pub fn visit_type_bare_fn_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeBareFn) {
+ _visitor.visit_bare_fn_type_mut(&mut _i . ty);
}
-pub fn visit_ty_group_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyGroup) {
+pub fn visit_type_binding_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeBinding) {
+ // Skipped field _i . ident;
+ // Skipped field _i . eq_token;
+ _visitor.visit_type_mut(&mut _i . ty);
+}
+
+pub fn visit_type_group_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeGroup) {
// Skipped field _i . group_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
}
-pub fn visit_ty_impl_trait_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyImplTrait) {
+pub fn visit_type_impl_trait_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeImplTrait) {
// Skipped field _i . impl_token;
- for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_bound_mut(&mut it) };
+ for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_bound_mut(&mut it) };
}
-pub fn visit_ty_infer_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyInfer) {
+pub fn visit_type_infer_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeInfer) {
// Skipped field _i . underscore_token;
}
-pub fn visit_ty_never_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyNever) {
+pub fn visit_type_never_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeNever) {
// Skipped field _i . bang_token;
}
-pub fn visit_ty_param_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyParam) {
+pub fn visit_type_param_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeParam) {
for mut it in (_i . attrs).iter_mut() { _visitor.visit_attribute_mut(&mut it) };
// Skipped field _i . ident;
// Skipped field _i . colon_token;
- for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_bound_mut(&mut it) };
+ for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_bound_mut(&mut it) };
// Skipped field _i . eq_token;
- if let Some(ref mut it) = _i . default { _visitor.visit_ty_mut(&mut * it) };
+ if let Some(ref mut it) = _i . default { _visitor.visit_type_mut(&mut * it) };
}
-pub fn visit_ty_param_bound_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyParamBound) {
- use ::TyParamBound::*;
+pub fn visit_type_param_bound_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeParamBound) {
+ use ::TypeParamBound::*;
match *_i {
Trait(ref mut _binding_0, ref mut _binding_1, ) => {
_visitor.visit_poly_trait_ref_mut(&mut * _binding_0);
@@ -1870,49 +1876,43 @@
}
}
-pub fn visit_ty_paren_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyParen) {
+pub fn visit_type_paren_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeParen) {
// Skipped field _i . paren_token;
- _visitor.visit_ty_mut(&mut _i . ty);
+ _visitor.visit_type_mut(&mut _i . ty);
}
-pub fn visit_ty_path_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyPath) {
+pub fn visit_type_path_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypePath) {
if let Some(ref mut it) = _i . qself { _visitor.visit_qself_mut(&mut * it) };
_visitor.visit_path_mut(&mut _i . path);
}
-pub fn visit_ty_ptr_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyPtr) {
+pub fn visit_type_ptr_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypePtr) {
// Skipped field _i . star_token;
// Skipped field _i . const_token;
- _visitor.visit_mut_ty_mut(&mut _i . ty);
+ _visitor.visit_mut_type_mut(&mut _i . ty);
}
-pub fn visit_ty_rptr_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyRptr) {
+pub fn visit_type_rptr_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeRptr) {
// Skipped field _i . and_token;
// Skipped field _i . lifetime;
- _visitor.visit_mut_ty_mut(&mut _i . ty);
+ _visitor.visit_mut_type_mut(&mut _i . ty);
}
-pub fn visit_ty_slice_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TySlice) {
- _visitor.visit_ty_mut(&mut _i . ty);
+pub fn visit_type_slice_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeSlice) {
+ _visitor.visit_type_mut(&mut _i . ty);
// Skipped field _i . bracket_token;
}
-pub fn visit_ty_trait_object_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyTraitObject) {
- for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_bound_mut(&mut it) };
+pub fn visit_type_trait_object_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeTraitObject) {
+ for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_bound_mut(&mut it) };
}
-pub fn visit_ty_tup_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TyTup) {
+pub fn visit_type_tup_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeTup) {
// Skipped field _i . paren_token;
- for mut el in (_i . tys).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_mut(&mut it) };
+ for mut el in (_i . tys).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_mut(&mut it) };
// Skipped field _i . lone_comma;
}
-pub fn visit_type_binding_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut TypeBinding) {
- // Skipped field _i . ident;
- // Skipped field _i . eq_token;
- _visitor.visit_ty_mut(&mut _i . ty);
-}
-
pub fn visit_un_op_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut UnOp) {
use ::UnOp::*;
match *_i {
@@ -2016,9 +2016,9 @@
pub fn visit_where_bound_predicate_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut WhereBoundPredicate) {
if let Some(ref mut it) = _i . bound_lifetimes { _visitor.visit_bound_lifetimes_mut(&mut * it) };
- _visitor.visit_ty_mut(&mut _i . bounded_ty);
+ _visitor.visit_type_mut(&mut _i . bounded_ty);
// Skipped field _i . colon_token;
- for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_ty_param_bound_mut(&mut it) };
+ for mut el in (_i . bounds).iter_mut() { let mut it = el.item_mut(); _visitor.visit_type_param_bound_mut(&mut it) };
}
pub fn visit_where_clause_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut WhereClause) {
@@ -2027,9 +2027,9 @@
}
pub fn visit_where_eq_predicate_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut WhereEqPredicate) {
- _visitor.visit_ty_mut(&mut _i . lhs_ty);
+ _visitor.visit_type_mut(&mut _i . lhs_ty);
// Skipped field _i . eq_token;
- _visitor.visit_ty_mut(&mut _i . rhs_ty);
+ _visitor.visit_type_mut(&mut _i . rhs_ty);
}
pub fn visit_where_predicate_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut WherePredicate) {
diff --git a/src/generics.rs b/src/generics.rs
index 71aadb3..950d5fb 100644
--- a/src/generics.rs
+++ b/src/generics.rs
@@ -9,7 +9,7 @@
pub lt_token: Option<Token![<]>,
pub gt_token: Option<Token![>]>,
pub lifetimes: Delimited<LifetimeDef, Token![,]>,
- pub ty_params: Delimited<TyParam, Token![,]>,
+ pub ty_params: Delimited<TypeParam, Token![,]>,
pub where_clause: WhereClause,
}
}
@@ -24,12 +24,12 @@
#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
#[cfg_attr(feature = "clone-impls", derive(Clone))]
/// Returned by `Generics::split_for_impl`.
-pub struct TyGenerics<'a>(&'a Generics);
+pub struct TypeGenerics<'a>(&'a Generics);
#[cfg(feature = "printing")]
#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
#[cfg_attr(feature = "clone-impls", derive(Clone))]
-/// Returned by `TyGenerics::as_turbofish`.
+/// Returned by `TypeGenerics::as_turbofish`.
pub struct Turbofish<'a>(&'a Generics);
#[cfg(feature = "printing")]
@@ -53,13 +53,13 @@
/// # ;
/// # }
/// ```
- pub fn split_for_impl(&self) -> (ImplGenerics, TyGenerics, &WhereClause) {
- (ImplGenerics(self), TyGenerics(self), &self.where_clause)
+ pub fn split_for_impl(&self) -> (ImplGenerics, TypeGenerics, &WhereClause) {
+ (ImplGenerics(self), TypeGenerics(self), &self.where_clause)
}
}
#[cfg(feature = "printing")]
-impl<'a> TyGenerics<'a> {
+impl<'a> TypeGenerics<'a> {
/// Turn a type's generics like `<X, Y>` into a turbofish like `::<X, Y>`.
pub fn as_turbofish(&self) -> Turbofish {
Turbofish(self.0)
@@ -100,19 +100,19 @@
ast_struct! {
/// A generic type parameter, e.g. `T: Into<String>`.
- pub struct TyParam {
+ pub struct TypeParam {
pub attrs: Vec<Attribute>,
pub ident: Ident,
pub colon_token: Option<Token![:]>,
- pub bounds: Delimited<TyParamBound, Token![+]>,
+ pub bounds: Delimited<TypeParamBound, Token![+]>,
pub eq_token: Option<Token![=]>,
- pub default: Option<Ty>,
+ pub default: Option<Type>,
}
}
-impl From<Ident> for TyParam {
+impl From<Ident> for TypeParam {
fn from(ident: Ident) -> Self {
- TyParam {
+ TypeParam {
attrs: vec![],
ident: ident,
colon_token: None,
@@ -128,7 +128,7 @@
/// `typeck::collect::compute_bounds` matches these against
/// the "special" built-in traits (see `middle::lang_items`) and
/// detects Copy, Send and Sync.
- pub enum TyParamBound {
+ pub enum TypeParamBound {
Trait(PolyTraitRef, TraitBoundModifier),
Region(Lifetime),
}
@@ -167,10 +167,10 @@
/// Any lifetimes from a `for` binding
pub bound_lifetimes: Option<BoundLifetimes>,
/// The type being bounded
- pub bounded_ty: Ty,
+ pub bounded_ty: Type,
pub colon_token: Token![:],
/// Trait and lifetime bounds (`Clone+Send+'static`)
- pub bounds: Delimited<TyParamBound, Token![+]>,
+ pub bounds: Delimited<TypeParamBound, Token![+]>,
}),
/// A lifetime predicate, e.g. `'a: 'b+'c`
@@ -182,9 +182,9 @@
/// An equality predicate (unsupported)
pub EqPredicate(WhereEqPredicate {
- pub lhs_ty: Ty,
+ pub lhs_ty: Type,
pub eq_token: Token![=],
- pub rhs_ty: Ty,
+ pub rhs_ty: Type,
}),
}
}
@@ -254,7 +254,7 @@
));
}
- impl Synom for TyParam {
+ impl Synom for TypeParam {
named!(parse -> Self, do_parse!(
attrs: many0!(call!(Attribute::parse_outer)) >>
id: syn!(Ident) >>
@@ -265,10 +265,10 @@
) >>
default: option!(do_parse!(
eq: punct!(=) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
(eq, ty)
)) >>
- (TyParam {
+ (TypeParam {
attrs: attrs,
ident: id,
bounds: bounds.unwrap_or_default(),
@@ -279,18 +279,18 @@
));
}
- impl Synom for TyParamBound {
+ impl Synom for TypeParamBound {
named!(parse -> Self, alt!(
do_parse!(
question: punct!(?) >>
poly: syn!(PolyTraitRef) >>
- (TyParamBound::Trait(poly, TraitBoundModifier::Maybe(question)))
+ (TypeParamBound::Trait(poly, TraitBoundModifier::Maybe(question)))
)
|
- syn!(Lifetime) => { TyParamBound::Region }
+ syn!(Lifetime) => { TypeParamBound::Region }
|
syn!(PolyTraitRef) => {
- |poly| TyParamBound::Trait(poly, TraitBoundModifier::None)
+ |poly| TypeParamBound::Trait(poly, TraitBoundModifier::None)
}
));
@@ -336,7 +336,7 @@
|
do_parse!(
bound_lifetimes: option!(syn!(BoundLifetimes)) >>
- bounded_ty: syn!(Ty) >>
+ bounded_ty: syn!(Type) >>
colon: punct!(:) >>
bounds: call!(Delimited::parse_separated_nonempty) >>
(WherePredicate::BoundPredicate(WhereBoundPredicate {
@@ -410,7 +410,7 @@
}
}
- impl<'a> ToTokens for TyGenerics<'a> {
+ impl<'a> ToTokens for TypeGenerics<'a> {
fn to_tokens(&self, tokens: &mut Tokens) {
if empty_normal_generics(&self.0) {
return;
@@ -436,7 +436,7 @@
fn to_tokens(&self, tokens: &mut Tokens) {
if !empty_normal_generics(&self.0) {
<Token![::]>::default().to_tokens(tokens);
- TyGenerics(self.0).to_tokens(tokens);
+ TypeGenerics(self.0).to_tokens(tokens);
}
}
}
@@ -461,7 +461,7 @@
}
}
- impl ToTokens for TyParam {
+ impl ToTokens for TypeParam {
fn to_tokens(&self, tokens: &mut Tokens) {
tokens.append_all(self.attrs.outer());
self.ident.to_tokens(tokens);
@@ -476,11 +476,11 @@
}
}
- impl ToTokens for TyParamBound {
+ impl ToTokens for TypeParamBound {
fn to_tokens(&self, tokens: &mut Tokens) {
match *self {
- TyParamBound::Region(ref lifetime) => lifetime.to_tokens(tokens),
- TyParamBound::Trait(ref trait_ref, ref modifier) => {
+ TypeParamBound::Region(ref lifetime) => lifetime.to_tokens(tokens),
+ TypeParamBound::Trait(ref trait_ref, ref modifier) => {
modifier.to_tokens(tokens);
trait_ref.to_tokens(tokens);
}
diff --git a/src/item.rs b/src/item.rs
index 77c83d1..30a4a58 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -36,7 +36,7 @@
pub mutbl: Mutability,
pub ident: Ident,
pub colon_token: Token![:],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
pub eq_token: Token![=],
pub expr: Box<Expr>,
pub semi_token: Token![;],
@@ -50,7 +50,7 @@
pub const_token: Token![const],
pub ident: Ident,
pub colon_token: Token![:],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
pub eq_token: Token![=],
pub expr: Box<Expr>,
pub semi_token: Token![;],
@@ -91,14 +91,14 @@
/// A type alias (`type` or `pub type`).
///
/// E.g. `type Foo = Bar<u8>;`
- pub Ty(ItemTy {
+ pub Type(ItemType {
pub attrs: Vec<Attribute>,
pub vis: Visibility,
pub type_token: Token![type],
pub ident: Ident,
pub generics: Generics,
pub eq_token: Token![=],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
pub semi_token: Token![;],
}),
/// An enum definition (`enum` or `pub enum`).
@@ -147,7 +147,7 @@
pub ident: Ident,
pub generics: Generics,
pub colon_token: Option<Token![:]>,
- pub supertraits: Delimited<TyParamBound, Token![+]>,
+ pub supertraits: Delimited<TypeParamBound, Token![+]>,
pub brace_token: tokens::Brace,
pub items: Vec<TraitItem>,
}),
@@ -175,7 +175,7 @@
/// Trait this impl implements.
pub trait_: Option<(ImplPolarity, Path, Token![for])>,
/// The Self type of the impl.
- pub self_ty: Box<Ty>,
+ pub self_ty: Box<Type>,
pub brace_token: tokens::Brace,
pub items: Vec<ImplItem>,
}),
@@ -294,7 +294,7 @@
pub mutbl: Mutability,
pub ident: Ident,
pub colon_token: Token![:],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
pub semi_token: Token![;],
}),
}
@@ -311,7 +311,7 @@
pub const_token: Token![const],
pub ident: Ident,
pub colon_token: Token![:],
- pub ty: Ty,
+ pub ty: Type,
pub default: Option<(Token![=], Expr)>,
pub semi_token: Token![;],
}),
@@ -326,8 +326,8 @@
pub type_token: Token![type],
pub ident: Ident,
pub colon_token: Option<Token![:]>,
- pub bounds: Delimited<TyParamBound, Token![+]>,
- pub default: Option<(Token![=], Ty)>,
+ pub bounds: Delimited<TypeParamBound, Token![+]>,
+ pub default: Option<(Token![=], Type)>,
pub semi_token: Token![;],
}),
pub Macro(TraitItemMacro {
@@ -356,7 +356,7 @@
pub const_token: Token![const],
pub ident: Ident,
pub colon_token: Token![:],
- pub ty: Ty,
+ pub ty: Type,
pub eq_token: Token![=],
pub expr: Expr,
pub semi_token: Token![;],
@@ -375,7 +375,7 @@
pub type_token: Token![type],
pub ident: Ident,
pub eq_token: Token![=],
- pub ty: Ty,
+ pub ty: Type,
pub semi_token: Token![;],
}),
pub Macro(ImplItemMacro {
@@ -430,9 +430,9 @@
pub Captured(ArgCaptured {
pub pat: Pat,
pub colon_token: Token![:],
- pub ty: Ty,
+ pub ty: Type,
}),
- pub Ignored(Ty),
+ pub Ignored(Type),
}
}
@@ -457,7 +457,7 @@
|
syn!(ItemForeignMod) => { Item::ForeignMod }
|
- syn!(ItemTy) => { Item::Ty }
+ syn!(ItemType) => { Item::Type }
|
syn!(ItemStruct) => { Item::Struct }
|
@@ -633,7 +633,7 @@
mutability: syn!(Mutability) >>
ident: syn!(Ident) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
eq: punct!(=) >>
value: syn!(Expr) >>
semi: punct!(;) >>
@@ -657,7 +657,7 @@
const_: keyword!(const) >>
ident: syn!(Ident) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
eq: punct!(=) >>
value: syn!(Expr) >>
semi: punct!(;) >>
@@ -749,7 +749,7 @@
do_parse!(
pat: syn!(Pat) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
(ArgCaptured {
pat: pat,
ty: ty,
@@ -757,7 +757,7 @@
}.into())
)
|
- syn!(Ty) => { FnArg::Ignored }
+ syn!(Type) => { FnArg::Ignored }
));
}
@@ -862,7 +862,7 @@
mutability: syn!(Mutability) >>
ident: syn!(Ident) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
semi: punct!(;) >>
(ForeignItemStatic {
ident: ident,
@@ -876,7 +876,7 @@
})
));
- impl_synom!(ItemTy "type item" do_parse!(
+ impl_synom!(ItemType "type item" do_parse!(
attrs: many0!(call!(Attribute::parse_outer)) >>
vis: syn!(Visibility) >>
type_: keyword!(type) >>
@@ -884,9 +884,9 @@
generics: syn!(Generics) >>
where_clause: syn!(WhereClause) >>
eq: punct!(=) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
semi: punct!(;) >>
- (ItemTy {
+ (ItemType {
attrs: attrs,
vis: vis,
type_token: type_,
@@ -1001,7 +1001,7 @@
const_: keyword!(const) >>
ident: syn!(Ident) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
default: option!(tuple!(punct!(=), syn!(Expr))) >>
semi: punct!(;) >>
(TraitItemConst {
@@ -1079,7 +1079,7 @@
bounds: cond!(colon.is_some(),
call!(Delimited::parse_separated_nonempty)
) >>
- default: option!(tuple!(punct!(=), syn!(Ty))) >>
+ default: option!(tuple!(punct!(=), syn!(Type))) >>
semi: punct!(;) >>
(TraitItemType {
attrs: attrs,
@@ -1118,7 +1118,7 @@
|
epsilon!() => { |_| None }
) >>
- self_ty: syn!(Ty) >>
+ self_ty: syn!(Type) >>
where_clause: syn!(WhereClause) >>
body: braces!(many0!(syn!(ImplItem))) >>
(ItemImpl {
@@ -1154,7 +1154,7 @@
const_: keyword!(const) >>
ident: syn!(Ident) >>
colon: punct!(:) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
eq: punct!(=) >>
value: syn!(Expr) >>
semi: punct!(;) >>
@@ -1229,7 +1229,7 @@
type_: keyword!(type) >>
ident: syn!(Ident) >>
eq: punct!(=) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
semi: punct!(;) >>
(ImplItemType {
attrs: attrs,
@@ -1381,7 +1381,7 @@
}
}
- impl ToTokens for ItemTy {
+ impl ToTokens for ItemType {
fn to_tokens(&self, tokens: &mut Tokens) {
tokens.append_all(self.attrs.outer());
self.vis.to_tokens(tokens);
diff --git a/src/lib.rs b/src/lib.rs
index 5c246cc..8fad211 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -40,11 +40,11 @@
PatLit, PatRange, PatSlice, InPlaceKind};
mod generics;
-pub use generics::{Generics, LifetimeDef, TraitBoundModifier, TyParam, TyParamBound,
+pub use generics::{Generics, LifetimeDef, TraitBoundModifier, TypeParam, TypeParamBound,
WhereBoundPredicate, WhereClause, WhereEqPredicate, WherePredicate,
WhereRegionPredicate, BoundLifetimes};
#[cfg(feature = "printing")]
-pub use generics::{ImplGenerics, Turbofish, TyGenerics};
+pub use generics::{ImplGenerics, Turbofish, TypeGenerics};
mod ident;
pub use ident::Ident;
@@ -55,7 +55,7 @@
pub use item::{Constness, Defaultness, FnArg, FnDecl, ForeignItem, ItemForeignMod,
ImplItem, ImplPolarity, Item, MethodSig, PathListItem,
TraitItem, ViewPath, ItemExternCrate, ItemUse,
- ItemStatic, ItemConst, ItemFn, ItemMacro, ItemMod, ItemTy, ItemEnum,
+ ItemStatic, ItemConst, ItemFn, ItemMacro, ItemMod, ItemType, ItemEnum,
ItemStruct, ItemUnion, ItemTrait, ItemDefaultImpl, ItemImpl,
PathSimple, PathGlob, PathList, ForeignItemFn, ForeignItemStatic,
TraitItemConst, TraitItemMacro, TraitItemMethod, TraitItemType,
@@ -83,11 +83,11 @@
pub use op::{BinOp, UnOp};
mod ty;
-pub use ty::{Abi, AbiKind, AngleBracketedParameterData, BareFnArg, BareFnArgName, BareFnTy,
- ReturnType, MutTy, Mutability, ParenthesizedParameterData, Path,
- PathParameters, PathSegment, PolyTraitRef, QSelf, Ty, TypeBinding, Unsafety,
- TySlice, TyArray, TyPtr, TyRptr, TyBareFn, TyNever, TyTup, TyPath,
- TyTraitObject, TyImplTrait, TyParen, TyInfer, TyGroup};
+pub use ty::{Abi, AbiKind, AngleBracketedParameterData, BareFnArg, BareFnArgName, BareFnType,
+ ReturnType, MutType, Mutability, ParenthesizedParameterData, Path,
+ PathParameters, PathSegment, PolyTraitRef, QSelf, Type, TypeBinding, Unsafety,
+ TypeSlice, TypeArray, TypePtr, TypeRptr, TypeBareFn, TypeNever, TypeTup, TypePath,
+ TypeTraitObject, TypeImplTrait, TypeParen, TypeInfer, TypeGroup};
#[cfg(feature = "printing")]
pub use ty::PathTokens;
diff --git a/src/ty.rs b/src/ty.rs
index 3321176..01ccfe5 100644
--- a/src/ty.rs
+++ b/src/ty.rs
@@ -3,77 +3,77 @@
ast_enum_of_structs! {
/// The different kinds of types recognized by the compiler
- pub enum Ty {
+ pub enum Type {
/// A variable-length array (`[T]`)
- pub Slice(TySlice {
- pub ty: Box<Ty>,
+ pub Slice(TypeSlice {
+ pub ty: Box<Type>,
pub bracket_token: tokens::Bracket,
}),
/// A fixed length array (`[T; n]`)
- pub Array(TyArray {
+ pub Array(TypeArray {
pub bracket_token: tokens::Bracket,
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
pub semi_token: Token![;],
pub amt: Expr,
}),
/// A raw pointer (`*const T` or `*mut T`)
- pub Ptr(TyPtr {
+ pub Ptr(TypePtr {
pub star_token: Token![*],
pub const_token: Option<Token![const]>,
- pub ty: Box<MutTy>,
+ pub ty: Box<MutType>,
}),
/// A reference (`&'a T` or `&'a mut T`)
- pub Rptr(TyRptr {
+ pub Rptr(TypeRptr {
pub and_token: Token![&],
pub lifetime: Option<Lifetime>,
- pub ty: Box<MutTy>,
+ pub ty: Box<MutType>,
}),
/// A bare function (e.g. `fn(usize) -> bool`)
- pub BareFn(TyBareFn {
- pub ty: Box<BareFnTy>,
+ pub BareFn(TypeBareFn {
+ pub ty: Box<BareFnType>,
}),
/// The never type (`!`)
- pub Never(TyNever {
+ pub Never(TypeNever {
pub bang_token: Token![!],
}),
/// A tuple (`(A, B, C, D, ...)`)
- pub Tup(TyTup {
+ pub Tup(TypeTup {
pub paren_token: tokens::Paren,
- pub tys: Delimited<Ty, Token![,]>,
+ pub tys: Delimited<Type, Token![,]>,
pub lone_comma: Option<Token![,]>,
}),
/// A path (`module::module::...::Type`), optionally
/// "qualified", e.g. `<Vec<T> as SomeTrait>::SomeType`.
///
/// Type parameters are stored in the Path itself
- pub Path(TyPath {
+ pub Path(TypePath {
pub qself: Option<QSelf>,
pub path: Path,
}),
/// A trait object type `Bound1 + Bound2 + Bound3`
/// where `Bound` is a trait or a lifetime.
- pub TraitObject(TyTraitObject {
- pub bounds: Delimited<TyParamBound, Token![+]>,
+ pub TraitObject(TypeTraitObject {
+ pub bounds: Delimited<TypeParamBound, Token![+]>,
}),
/// An `impl Bound1 + Bound2 + Bound3` type
/// where `Bound` is a trait or a lifetime.
- pub ImplTrait(TyImplTrait {
+ pub ImplTrait(TypeImplTrait {
pub impl_token: Token![impl],
- pub bounds: Delimited<TyParamBound, Token![+]>,
+ pub bounds: Delimited<TypeParamBound, Token![+]>,
}),
/// No-op; kept solely so that we can pretty-print faithfully
- pub Paren(TyParen {
+ pub Paren(TypeParen {
pub paren_token: tokens::Paren,
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
}),
/// No-op: kept solely so that we can pretty-print faithfully
- pub Group(TyGroup {
+ pub Group(TypeGroup {
pub group_token: tokens::Group,
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
}),
- /// TyKind::Infer means the type should be inferred instead of it having been
+ /// TypeKind::Infer means the type should be inferred instead of it having been
/// specified. This can appear anywhere in a type.
- pub Infer(TyInfer {
+ pub Infer(TypeInfer {
pub underscore_token: Token![_],
}),
/// A macro in the type position.
@@ -82,8 +82,8 @@
}
ast_struct! {
- pub struct MutTy {
- pub ty: Ty,
+ pub struct MutType {
+ pub ty: Type,
pub mutability: Mutability,
}
}
@@ -201,7 +201,7 @@
/// The lifetime parameters for this path segment.
pub lifetimes: Delimited<Lifetime, Token![,]>,
/// The type parameters for this path segment, if present.
- pub types: Delimited<Ty, Token![,]>,
+ pub types: Delimited<Type, Token![,]>,
/// Bindings (equality constraints) on associated types, if present.
///
/// E.g., `Foo<A=Bar>`.
@@ -215,7 +215,7 @@
pub struct TypeBinding {
pub ident: Ident,
pub eq_token: Token![=],
- pub ty: Ty,
+ pub ty: Type,
}
}
@@ -225,7 +225,7 @@
pub struct ParenthesizedParameterData {
pub paren_token: tokens::Paren,
/// `(A, B)`
- pub inputs: Delimited<Ty, Token![,]>,
+ pub inputs: Delimited<Type, Token![,]>,
/// `C`
pub output: ReturnType,
}
@@ -257,7 +257,7 @@
/// ```
pub struct QSelf {
pub lt_token: Token![<],
- pub ty: Box<Ty>,
+ pub ty: Box<Type>,
pub position: usize,
pub as_token: Option<Token![as]>,
pub gt_token: Token![>],
@@ -265,7 +265,7 @@
}
ast_struct! {
- pub struct BareFnTy {
+ pub struct BareFnType {
pub lifetimes: Option<BoundLifetimes>,
pub unsafety: Unsafety,
pub abi: Option<Abi>,
@@ -305,7 +305,7 @@
/// E.g. `bar: usize` as in `fn foo(bar: usize)`
pub struct BareFnArg {
pub name: Option<(BareFnArgName, Token![:])>,
- pub ty: Ty,
+ pub ty: Type,
}
}
@@ -328,7 +328,7 @@
/// type would be inserted.
Default,
/// Everything else
- Ty(Ty, Token![->]),
+ Type(Type, Token![->]),
}
}
@@ -337,7 +337,7 @@
use super::*;
use synom::Synom;
- impl Synom for Ty {
+ impl Synom for Type {
named!(parse -> Self, call!(ambig_ty, true));
fn description() -> Option<&'static str> {
@@ -345,7 +345,7 @@
}
}
- impl Ty {
+ impl Type {
/// In some positions, types may not contain the `+` character, to
/// disambiguate them. For example in the expression `1 as T`, T may not
/// contain a `+` character.
@@ -354,60 +354,60 @@
named!(pub without_plus -> Self, call!(ambig_ty, false));
}
- named!(ambig_ty(allow_plus: bool) -> Ty, alt!(
- syn!(TyGroup) => { Ty::Group }
+ named!(ambig_ty(allow_plus: bool) -> Type, alt!(
+ syn!(TypeGroup) => { Type::Group }
|
// must be before mac
- syn!(TyParen) => { Ty::Paren }
+ syn!(TypeParen) => { Type::Paren }
|
// must be before path
- syn!(Macro) => { Ty::Macro }
+ syn!(Macro) => { Type::Macro }
|
// must be before ty_poly_trait_ref
call!(ty_path, allow_plus)
|
- syn!(TySlice) => { Ty::Slice }
+ syn!(TypeSlice) => { Type::Slice }
|
- syn!(TyArray) => { Ty::Array }
+ syn!(TypeArray) => { Type::Array }
|
- syn!(TyPtr) => { Ty::Ptr }
+ syn!(TypePtr) => { Type::Ptr }
|
- syn!(TyRptr) => { Ty::Rptr }
+ syn!(TypeRptr) => { Type::Rptr }
|
- syn!(TyBareFn) => { Ty::BareFn }
+ syn!(TypeBareFn) => { Type::BareFn }
|
- syn!(TyNever) => { Ty::Never }
+ syn!(TypeNever) => { Type::Never }
|
- syn!(TyTup) => { Ty::Tup }
+ syn!(TypeTup) => { Type::Tup }
|
// Don't try parsing poly_trait_ref if we aren't allowing it
call!(ty_poly_trait_ref, allow_plus)
|
- syn!(TyImplTrait) => { Ty::ImplTrait }
+ syn!(TypeImplTrait) => { Type::ImplTrait }
|
- syn!(TyInfer) => { Ty::Infer }
+ syn!(TypeInfer) => { Type::Infer }
));
- impl Synom for TySlice {
+ impl Synom for TypeSlice {
named!(parse -> Self, map!(
- brackets!(syn!(Ty)),
- |(ty, b)| TySlice {
+ brackets!(syn!(Type)),
+ |(ty, b)| TypeSlice {
ty: Box::new(ty),
bracket_token: b,
}
));
}
- impl Synom for TyArray {
+ impl Synom for TypeArray {
named!(parse -> Self, map!(
brackets!(do_parse!(
- elem: syn!(Ty) >>
+ elem: syn!(Type) >>
semi: punct!(;) >>
len: syn!(Expr) >>
(elem, semi, len)
)),
|((elem, semi, len), brackets)| {
- TyArray {
+ TypeArray {
ty: Box::new(elem),
amt: len,
bracket_token: brackets,
@@ -417,7 +417,7 @@
));
}
- impl Synom for TyPtr {
+ impl Synom for TypePtr {
named!(parse -> Self, do_parse!(
star: punct!(*) >>
mutability: alt!(
@@ -425,11 +425,11 @@
|
keyword!(mut) => { |m| (Mutability::Mutable(m), None) }
) >>
- target: call!(Ty::without_plus) >>
- (TyPtr {
+ target: call!(Type::without_plus) >>
+ (TypePtr {
const_token: mutability.1,
star_token: star,
- ty: Box::new(MutTy {
+ ty: Box::new(MutType {
ty: target,
mutability: mutability.0,
}),
@@ -437,16 +437,16 @@
));
}
- impl Synom for TyRptr {
+ impl Synom for TypeRptr {
named!(parse -> Self, do_parse!(
amp: punct!(&) >>
life: option!(syn!(Lifetime)) >>
mutability: syn!(Mutability) >>
// & binds tighter than +, so we don't allow + here.
- target: call!(Ty::without_plus) >>
- (TyRptr {
+ target: call!(Type::without_plus) >>
+ (TypeRptr {
lifetime: life,
- ty: Box::new(MutTy {
+ ty: Box::new(MutType {
ty: target,
mutability: mutability,
}),
@@ -455,7 +455,7 @@
));
}
- impl Synom for TyBareFn {
+ impl Synom for TypeBareFn {
named!(parse -> Self, do_parse!(
lifetimes: option!(syn!(BoundLifetimes)) >>
unsafety: syn!(Unsafety) >>
@@ -468,8 +468,8 @@
(inputs, variadic)
)) >>
output: syn!(ReturnType) >>
- (TyBareFn {
- ty: Box::new(BareFnTy {
+ (TypeBareFn {
+ ty: Box::new(BareFnType {
unsafety: unsafety,
abi: abi,
lifetimes: lifetimes,
@@ -483,24 +483,24 @@
));
}
- impl Synom for TyNever {
+ impl Synom for TypeNever {
named!(parse -> Self, map!(
punct!(!),
- |b| TyNever { bang_token: b }
+ |b| TypeNever { bang_token: b }
));
}
- impl Synom for TyInfer {
+ impl Synom for TypeInfer {
named!(parse -> Self, map!(
punct!(_),
- |u| TyInfer { underscore_token: u }
+ |u| TypeInfer { underscore_token: u }
));
}
- impl Synom for TyTup {
+ impl Synom for TypeTup {
named!(parse -> Self, do_parse!(
data: parens!(call!(Delimited::parse_terminated)) >>
- (TyTup {
+ (TypeTup {
tys: data.0,
paren_token: data.1,
lone_comma: None, // TODO: does this just not parse?
@@ -508,7 +508,7 @@
));
}
- named!(ty_path(allow_plus: bool) -> Ty, do_parse!(
+ named!(ty_path(allow_plus: bool) -> Type, do_parse!(
qpath: qpath >>
parenthesized: cond!(
qpath.1.segments.get(qpath.1.segments.len() - 1).item().parameters.is_empty(),
@@ -518,7 +518,7 @@
bounds: alt!(
cond_reduce!(
allow_plus,
- many0!(tuple!(punct!(+), syn!(TyParamBound)))
+ many0!(tuple!(punct!(+), syn!(TypeParamBound)))
)
|
value!(vec![])
@@ -531,9 +531,9 @@
path.segments.get_mut(len - 1).item_mut().parameters = parenthesized;
}
if bounds.is_empty() {
- TyPath { qself: qself, path: path }.into()
+ TypePath { qself: qself, path: path }.into()
} else {
- let path = TyParamBound::Trait(
+ let path = TypeParamBound::Trait(
PolyTraitRef {
bound_lifetimes: None,
trait_ref: path,
@@ -545,7 +545,7 @@
for (_tok, bound) in bounds {
new_bounds.push_default(bound);
}
- TyTraitObject { bounds: new_bounds }.into()
+ TypeTraitObject { bounds: new_bounds }.into()
}
})
));
@@ -555,7 +555,7 @@
|
do_parse!(
lt: punct!(<) >>
- this: syn!(Ty) >>
+ this: syn!(Type) >>
path: option!(do_parse!(
as_: keyword!(as) >>
path: syn!(Path) >>
@@ -612,8 +612,8 @@
named!(parse -> Self, alt!(
do_parse!(
arrow: punct!(->) >>
- ty: syn!(Ty) >>
- (ReturnType::Ty(ty, arrow))
+ ty: syn!(Type) >>
+ (ReturnType::Type(ty, arrow))
)
|
epsilon!() => { |_| ReturnType::Default }
@@ -621,43 +621,43 @@
}
// Only allow multiple trait references if allow_plus is true.
- named!(ty_poly_trait_ref(allow_plus: bool) -> Ty, alt!(
+ named!(ty_poly_trait_ref(allow_plus: bool) -> Type, alt!(
cond_reduce!(allow_plus, call!(Delimited::parse_separated_nonempty)) => {
- |x| TyTraitObject { bounds: x }.into()
+ |x| TypeTraitObject { bounds: x }.into()
}
|
- syn!(TyParamBound) => {
- |x| TyTraitObject { bounds: vec![x].into() }.into()
+ syn!(TypeParamBound) => {
+ |x| TypeTraitObject { bounds: vec![x].into() }.into()
}
));
- impl Synom for TyImplTrait {
+ impl Synom for TypeImplTrait {
named!(parse -> Self, do_parse!(
impl_: keyword!(impl) >>
// NOTE: rust-lang/rust#34511 includes discussion about whether or
// not + should be allowed in ImplTrait directly without ().
elem: call!(Delimited::parse_separated_nonempty) >>
- (TyImplTrait {
+ (TypeImplTrait {
impl_token: impl_,
bounds: elem,
})
));
}
- impl Synom for TyGroup {
+ impl Synom for TypeGroup {
named!(parse -> Self, do_parse!(
- data: grouped!(syn!(Ty)) >>
- (TyGroup {
+ data: grouped!(syn!(Type)) >>
+ (TypeGroup {
group_token: data.1,
ty: Box::new(data.0),
})
));
}
- impl Synom for TyParen {
+ impl Synom for TypeParen {
named!(parse -> Self, do_parse!(
- data: parens!(syn!(Ty)) >>
- (TyParen {
+ data: parens!(syn!(Type)) >>
+ (TypeParen {
paren_token: data.1,
ty: Box::new(data.0),
})
@@ -726,7 +726,7 @@
));
}
- named!(ty_no_eq_after -> Ty, terminated!(syn!(Ty), not!(punct!(=))));
+ named!(ty_no_eq_after -> Type, terminated!(syn!(Type), not!(punct!(=))));
impl Path {
named!(pub parse_mod_style -> Self, do_parse!(
@@ -756,7 +756,7 @@
named!(parse -> Self, do_parse!(
id: syn!(Ident) >>
eq: punct!(=) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
(TypeBinding {
ident: id,
eq_token: eq,
@@ -796,7 +796,7 @@
colon: punct!(:) >>
(name, colon)
)) >>
- ty: syn!(Ty) >>
+ ty: syn!(Type) >>
(BareFnArg {
name: name,
ty: ty,
@@ -841,7 +841,7 @@
use super::*;
use quote::{Tokens, ToTokens};
- impl ToTokens for TySlice {
+ impl ToTokens for TypeSlice {
fn to_tokens(&self, tokens: &mut Tokens) {
self.bracket_token.surround(tokens, |tokens| {
self.ty.to_tokens(tokens);
@@ -849,7 +849,7 @@
}
}
- impl ToTokens for TyArray {
+ impl ToTokens for TypeArray {
fn to_tokens(&self, tokens: &mut Tokens) {
self.bracket_token.surround(tokens, |tokens| {
self.ty.to_tokens(tokens);
@@ -859,7 +859,7 @@
}
}
- impl ToTokens for TyPtr {
+ impl ToTokens for TypePtr {
fn to_tokens(&self, tokens: &mut Tokens) {
self.star_token.to_tokens(tokens);
match self.ty.mutability {
@@ -872,7 +872,7 @@
}
}
- impl ToTokens for TyRptr {
+ impl ToTokens for TypeRptr {
fn to_tokens(&self, tokens: &mut Tokens) {
self.and_token.to_tokens(tokens);
self.lifetime.to_tokens(tokens);
@@ -881,19 +881,19 @@
}
}
- impl ToTokens for TyBareFn {
+ impl ToTokens for TypeBareFn {
fn to_tokens(&self, tokens: &mut Tokens) {
self.ty.to_tokens(tokens)
}
}
- impl ToTokens for TyNever {
+ impl ToTokens for TypeNever {
fn to_tokens(&self, tokens: &mut Tokens) {
self.bang_token.to_tokens(tokens);
}
}
- impl ToTokens for TyTup {
+ impl ToTokens for TypeTup {
fn to_tokens(&self, tokens: &mut Tokens) {
self.paren_token.surround(tokens, |tokens| {
self.tys.to_tokens(tokens);
@@ -903,7 +903,7 @@
}
}
- impl ToTokens for TyPath {
+ impl ToTokens for TypePath {
fn to_tokens(&self, tokens: &mut Tokens) {
PathTokens(&self.qself, &self.path).to_tokens(tokens);
}
@@ -947,20 +947,20 @@
}
}
- impl ToTokens for TyTraitObject {
+ impl ToTokens for TypeTraitObject {
fn to_tokens(&self, tokens: &mut Tokens) {
self.bounds.to_tokens(tokens);
}
}
- impl ToTokens for TyImplTrait {
+ impl ToTokens for TypeImplTrait {
fn to_tokens(&self, tokens: &mut Tokens) {
self.impl_token.to_tokens(tokens);
self.bounds.to_tokens(tokens);
}
}
- impl ToTokens for TyGroup {
+ impl ToTokens for TypeGroup {
fn to_tokens(&self, tokens: &mut Tokens) {
self.group_token.surround(tokens, |tokens| {
self.ty.to_tokens(tokens);
@@ -968,7 +968,7 @@
}
}
- impl ToTokens for TyParen {
+ impl ToTokens for TypeParen {
fn to_tokens(&self, tokens: &mut Tokens) {
self.paren_token.surround(tokens, |tokens| {
self.ty.to_tokens(tokens);
@@ -976,7 +976,7 @@
}
}
- impl ToTokens for TyInfer {
+ impl ToTokens for TypeInfer {
fn to_tokens(&self, tokens: &mut Tokens) {
self.underscore_token.to_tokens(tokens);
}
@@ -1064,7 +1064,7 @@
fn to_tokens(&self, tokens: &mut Tokens) {
match *self {
ReturnType::Default => {}
- ReturnType::Ty(ref ty, ref arrow) => {
+ ReturnType::Type(ref ty, ref arrow) => {
arrow.to_tokens(tokens);
ty.to_tokens(tokens);
}
@@ -1079,7 +1079,7 @@
}
}
- impl ToTokens for BareFnTy {
+ impl ToTokens for BareFnType {
fn to_tokens(&self, tokens: &mut Tokens) {
self.lifetimes.to_tokens(tokens);
self.unsafety.to_tokens(tokens);
diff --git a/syn_codegen/src/main.rs b/syn_codegen/src/main.rs
index 8558fef..ecf0936 100644
--- a/syn_codegen/src/main.rs
+++ b/syn_codegen/src/main.rs
@@ -285,9 +285,9 @@
name.as_ref().to_snake_case().into()
}
- fn last_segment(ty: &Ty) -> Option<&PathSegment> {
+ fn last_segment(ty: &Type) -> Option<&PathSegment> {
match *ty {
- Ty::Path(ref typath) => {
+ Type::Path(ref typath) => {
if typath.qself.is_some() {
return None;
}
@@ -308,7 +308,7 @@
Fold,
}
- fn first_param(params: &PathParameters) -> &Ty {
+ fn first_param(params: &PathParameters) -> &Type {
let data = match *params {
PathParameters::AngleBracketed(ref data) => data,
_ => panic!("Expected at least 1 type parameter here"),
@@ -493,7 +493,7 @@
None
}
- fn visit(ty: &Ty, lookup: &Lookup, kind: Kind, name: &Tokens) -> String {
+ fn visit(ty: &Type, lookup: &Lookup, kind: Kind, name: &Tokens) -> String {
if let Some(seg) = last_segment(ty) {
let mut eos_full = false;
if let Some(res) = option_visit(seg, lookup, kind, name, &mut eos_full) {
diff --git a/synom/src/helper.rs b/synom/src/helper.rs
index f62febf..3272718 100644
--- a/synom/src/helper.rs
+++ b/synom/src/helper.rs
@@ -42,11 +42,11 @@
/// extern crate syn;
/// #[macro_use] extern crate synom;
///
-/// use syn::{Lifetime, Ty};
+/// use syn::{Lifetime, Type};
/// use syn::delimited::Delimited;
/// use syn::tokens::*;
///
-/// named!(bound_lifetimes -> (Vec<Lifetime>, Ty), tuple!(
+/// named!(bound_lifetimes -> (Vec<Lifetime>, Type), tuple!(
/// opt_vec!(do_parse!(
/// keyword!(for) >>
/// punct!(<) >>
@@ -54,7 +54,7 @@
/// punct!(>) >>
/// (lifetimes.into_vec())
/// )),
-/// syn!(Ty)
+/// syn!(Type)
/// ));
///
/// # fn main() {}
diff --git a/synom/src/lib.rs b/synom/src/lib.rs
index e8ad32a..8cf09ac 100644
--- a/synom/src/lib.rs
+++ b/synom/src/lib.rs
@@ -114,10 +114,10 @@
/// ```rust
/// # extern crate syn;
/// # #[macro_use] extern crate synom;
-/// # use syn::Ty;
+/// # use syn::Type;
/// # use synom::delimited::Delimited;
/// // One or more Rust types separated by commas.
-/// named!(pub comma_separated_types -> Delimited<Ty, Token![,]>,
+/// named!(pub comma_separated_types -> Delimited<Type, Token![,]>,
/// call!(Delimited::parse_separated_nonempty)
/// );
/// # fn main() {}
@@ -449,7 +449,7 @@
/// extern crate syn;
/// #[macro_use] extern crate synom;
///
-/// use syn::{Ident, Ty};
+/// use syn::{Ident, Type};
///
/// #[derive(Debug)]
/// enum UnitType {
@@ -606,9 +606,9 @@
/// extern crate syn;
/// #[macro_use] extern crate synom;
///
-/// use syn::Ty;
+/// use syn::Type;
///
-/// named!(two_types -> (Ty, Ty), tuple!(syn!(Ty), syn!(Ty)));
+/// named!(two_types -> (Type, Type), tuple!(syn!(Type), syn!(Type)));
///
/// # fn main() {}
/// ```
diff --git a/tests/test_derive_input.rs b/tests/test_derive_input.rs
index bd56825..d4a48ee 100644
--- a/tests/test_derive_input.rs
+++ b/tests/test_derive_input.rs
@@ -95,7 +95,7 @@
pub_token: Default::default(),
}),
attrs: Vec::new(),
- ty: TyPath {
+ ty: TypePath {
qself: None,
path: "Ident".into(),
}.into(),
@@ -107,7 +107,7 @@
pub_token: Default::default(),
}),
attrs: Vec::new(),
- ty: TyPath {
+ ty: TypePath {
qself: None,
path: Path {
leading_colon: None,
@@ -119,7 +119,7 @@
turbofish: None,
lt_token: Default::default(),
lifetimes: Default::default(),
- types: vec![Ty::from(TyPath {
+ types: vec![Type::from(TypePath {
qself: None,
path: "Attribute".into(),
})].into(),
@@ -200,7 +200,7 @@
lt_token: Some(Default::default()),
gt_token: Some(Default::default()),
ty_params: vec![
- TyParam {
+ TypeParam {
attrs: Vec::new(),
ident: "T".into(),
bounds: Default::default(),
@@ -208,7 +208,7 @@
colon_token: None,
eq_token: None,
},
- TyParam {
+ TypeParam {
attrs: Vec::new(),
ident: "E".into(),
bounds: Default::default(),
@@ -231,7 +231,7 @@
ident: None,
vis: Visibility::Inherited(VisInherited {}),
attrs: Vec::new(),
- ty: TyPath { qself: None, path: "T".into() }.into(),
+ ty: TypePath { qself: None, path: "T".into() }.into(),
},
].into(), Default::default()),
discriminant: None,
@@ -246,7 +246,7 @@
colon_token: None,
vis: Visibility::Inherited(VisInherited {}),
attrs: Vec::new(),
- ty: TyPath { qself: None, path: "E".into() }.into(),
+ ty: TypePath { qself: None, path: "E".into() }.into(),
},
].into(), Default::default()),
discriminant: None,
@@ -500,7 +500,7 @@
}),
colon_token: None,
attrs: vec![],
- ty: TyPath {
+ ty: TypePath {
qself: None,
path: "u8".into(),
}.into(),
diff --git a/tests/test_generics.rs b/tests/test_generics.rs
index 148b879..eda415b 100644
--- a/tests/test_generics.rs
+++ b/tests/test_generics.rs
@@ -32,7 +32,7 @@
},
].into(),
ty_params: vec![
- TyParam {
+ TypeParam {
attrs: vec![Attribute {
bracket_token: Default::default(),
pound_token: Default::default(),
@@ -42,8 +42,8 @@
is_sugared_doc: false,
}],
ident: "T".into(),
- bounds: vec![TyParamBound::Region(Lifetime::new(Term::intern("'a"), Span::default()))].into(),
- default: Some(TyTup {
+ bounds: vec![TypeParamBound::Region(Lifetime::new(Term::intern("'a"), Span::default()))].into(),
+ default: Some(TypeTup {
tys: Default::default(),
lone_comma: None,
paren_token: Default::default(),
@@ -58,12 +58,12 @@
WherePredicate::BoundPredicate(WhereBoundPredicate {
bound_lifetimes: None,
colon_token: Default::default(),
- bounded_ty: TyPath {
+ bounded_ty: TypePath {
qself: None,
path: "T".into(),
}.into(),
bounds: vec![
- TyParamBound::Trait(
+ TypeParamBound::Trait(
PolyTraitRef {
bound_lifetimes: None,
trait_ref: "Debug".into(),
@@ -97,24 +97,24 @@
#[test]
fn test_ty_param_bound() {
let tokens = quote!('a);
- let expected = TyParamBound::Region(Lifetime::new(Term::intern("'a"), Span::default()));
- assert_eq!(expected, common::parse::syn::<TyParamBound>(tokens.into()));
+ let expected = TypeParamBound::Region(Lifetime::new(Term::intern("'a"), Span::default()));
+ assert_eq!(expected, common::parse::syn::<TypeParamBound>(tokens.into()));
let tokens = quote!(Debug);
- let expected = TyParamBound::Trait(
+ let expected = TypeParamBound::Trait(
PolyTraitRef {
bound_lifetimes: None,
trait_ref: "Debug".into(),
},
TraitBoundModifier::None);
- assert_eq!(expected, common::parse::syn::<TyParamBound>(tokens.into()));
+ assert_eq!(expected, common::parse::syn::<TypeParamBound>(tokens.into()));
let tokens = quote!(?Sized);
- let expected = TyParamBound::Trait(
+ let expected = TypeParamBound::Trait(
PolyTraitRef {
bound_lifetimes: None,
trait_ref: "Sized".into(),
},
TraitBoundModifier::Maybe(Default::default()));
- assert_eq!(expected, common::parse::syn::<TyParamBound>(tokens.into()));
+ assert_eq!(expected, common::parse::syn::<TypeParamBound>(tokens.into()));
}
diff --git a/tests/test_precedence.rs b/tests/test_precedence.rs
index 87dada8..19dc3ad 100644
--- a/tests/test_precedence.rs
+++ b/tests/test_precedence.rs
@@ -345,7 +345,7 @@
pat
}
- fn fold_ty(&mut self, ty: Ty) -> Ty {
+ fn fold_type(&mut self, ty: Type) -> Type {
ty
}
}