summaryrefslogtreecommitdiffstats
path: root/vendor/syn/tests/test_generics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/syn/tests/test_generics.rs')
-rw-r--r--vendor/syn/tests/test_generics.rs69
1 files changed, 30 insertions, 39 deletions
diff --git a/vendor/syn/tests/test_generics.rs b/vendor/syn/tests/test_generics.rs
index 330f02f4d..51119adc8 100644
--- a/vendor/syn/tests/test_generics.rs
+++ b/vendor/syn/tests/test_generics.rs
@@ -1,4 +1,8 @@
-#![allow(clippy::too_many_lines)]
+#![allow(
+ clippy::manual_let_else,
+ clippy::too_many_lines,
+ clippy::uninlined_format_args
+)]
#[macro_use]
mod macros;
@@ -14,17 +18,17 @@ fn test_split_for_impl() {
snapshot!(input as DeriveInput, @r###"
DeriveInput {
- vis: Inherited,
+ vis: Visibility::Inherited,
ident: "S",
generics: Generics {
lt_token: Some,
params: [
- Lifetime(LifetimeDef {
+ GenericParam::Lifetime(LifetimeParam {
lifetime: Lifetime {
ident: "a",
},
}),
- Lifetime(LifetimeDef {
+ GenericParam::Lifetime(LifetimeParam {
lifetime: Lifetime {
ident: "b",
},
@@ -35,27 +39,25 @@ fn test_split_for_impl() {
},
],
}),
- Type(TypeParam {
+ GenericParam::Type(TypeParam {
attrs: [
Attribute {
- style: Outer,
- path: Path {
+ style: AttrStyle::Outer,
+ meta: Meta::Path {
segments: [
PathSegment {
ident: "may_dangle",
- arguments: None,
},
],
},
- tokens: TokenStream(``),
},
],
ident: "T",
colon_token: Some,
bounds: [
- Lifetime(Lifetime {
+ TypeParamBound::Lifetime {
ident: "a",
- }),
+ },
],
eq_token: Some,
default: Some(Type::Tuple),
@@ -64,25 +66,22 @@ fn test_split_for_impl() {
gt_token: Some,
where_clause: Some(WhereClause {
predicates: [
- Type(PredicateType {
+ WherePredicate::Type(PredicateType {
bounded_ty: Type::Path {
path: Path {
segments: [
PathSegment {
ident: "T",
- arguments: None,
},
],
},
},
bounds: [
- Trait(TraitBound {
- modifier: None,
+ TypeParamBound::Trait(TraitBound {
path: Path {
segments: [
PathSegment {
ident: "Debug",
- arguments: None,
},
],
},
@@ -93,7 +92,7 @@ fn test_split_for_impl() {
}),
},
data: Data::Struct {
- fields: Unit,
+ fields: Fields::Unit,
semi_token: Some,
},
}
@@ -128,27 +127,25 @@ fn test_split_for_impl() {
fn test_ty_param_bound() {
let tokens = quote!('a);
snapshot!(tokens as TypeParamBound, @r###"
- Lifetime(Lifetime {
+ TypeParamBound::Lifetime {
ident: "a",
- })
+ }
"###);
let tokens = quote!('_);
snapshot!(tokens as TypeParamBound, @r###"
- Lifetime(Lifetime {
+ TypeParamBound::Lifetime {
ident: "_",
- })
+ }
"###);
let tokens = quote!(Debug);
snapshot!(tokens as TypeParamBound, @r###"
- Trait(TraitBound {
- modifier: None,
+ TypeParamBound::Trait(TraitBound {
path: Path {
segments: [
PathSegment {
ident: "Debug",
- arguments: None,
},
],
},
@@ -157,13 +154,12 @@ fn test_ty_param_bound() {
let tokens = quote!(?Sized);
snapshot!(tokens as TypeParamBound, @r###"
- Trait(TraitBound {
- modifier: Maybe,
+ TypeParamBound::Trait(TraitBound {
+ modifier: TraitBoundModifier::Maybe,
path: Path {
segments: [
PathSegment {
ident: "Sized",
- arguments: None,
},
],
},
@@ -185,45 +181,42 @@ fn test_fn_precedence_in_where_clause() {
snapshot!(input as ItemFn, @r###"
ItemFn {
- vis: Inherited,
+ vis: Visibility::Inherited,
sig: Signature {
ident: "f",
generics: Generics {
lt_token: Some,
params: [
- Type(TypeParam {
+ GenericParam::Type(TypeParam {
ident: "G",
}),
],
gt_token: Some,
where_clause: Some(WhereClause {
predicates: [
- Type(PredicateType {
+ WherePredicate::Type(PredicateType {
bounded_ty: Type::Path {
path: Path {
segments: [
PathSegment {
ident: "G",
- arguments: None,
},
],
},
},
bounds: [
- Trait(TraitBound {
- modifier: None,
+ TypeParamBound::Trait(TraitBound {
path: Path {
segments: [
PathSegment {
ident: "FnOnce",
arguments: PathArguments::Parenthesized {
- output: Type(
+ output: ReturnType::Type(
Type::Path {
path: Path {
segments: [
PathSegment {
ident: "i32",
- arguments: None,
},
],
},
@@ -234,13 +227,11 @@ fn test_fn_precedence_in_where_clause() {
],
},
}),
- Trait(TraitBound {
- modifier: None,
+ TypeParamBound::Trait(TraitBound {
path: Path {
segments: [
PathSegment {
ident: "Send",
- arguments: None,
},
],
},
@@ -250,7 +241,7 @@ fn test_fn_precedence_in_where_clause() {
],
}),
},
- output: Default,
+ output: ReturnType::Default,
},
block: Block,
}