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_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()));
}