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/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
}
}