mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 21:48:02 +00:00
Bump syntex/aster/quasi version
This commit is contained in:
+11
-11
@@ -151,7 +151,7 @@ fn serialize_item_struct(
|
||||
)
|
||||
}
|
||||
ast::VariantData::Tuple(ref fields, _) => {
|
||||
if fields.iter().any(|field| !field.node.kind.is_unnamed()) {
|
||||
if fields.iter().any(|field| field.ident.is_some()) {
|
||||
cx.span_bug(span, "tuple struct has named fields")
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ fn serialize_item_struct(
|
||||
)
|
||||
}
|
||||
ast::VariantData::Struct(ref fields, _) => {
|
||||
if fields.iter().any(|field| field.node.kind.is_unnamed()) {
|
||||
if fields.iter().any(|field| field.ident.is_none()) {
|
||||
cx.span_bug(span, "struct has unnamed fields")
|
||||
}
|
||||
|
||||
@@ -399,9 +399,9 @@ fn serialize_variant(
|
||||
field_names.iter()
|
||||
.zip(fields.iter())
|
||||
.map(|(id, field)| {
|
||||
let name = match field.node.kind {
|
||||
ast::NamedField(name, _) => name,
|
||||
ast::UnnamedField(_) => {
|
||||
let name = match field.ident {
|
||||
Some(name) => name,
|
||||
None => {
|
||||
cx.span_bug(field.span, "struct variant has unnamed fields")
|
||||
}
|
||||
};
|
||||
@@ -447,7 +447,7 @@ fn serialize_tuple_variant(
|
||||
builder.ty()
|
||||
.ref_()
|
||||
.lifetime("'__a")
|
||||
.build_ty(field.node.ty.clone())
|
||||
.build_ty(field.ty.clone())
|
||||
})
|
||||
)
|
||||
.build();
|
||||
@@ -502,12 +502,12 @@ fn serialize_struct_variant(
|
||||
.with_generics(variant_generics.clone())
|
||||
.with_fields(
|
||||
fields.iter().map(|field| {
|
||||
builder.struct_field(field.node.ident().expect("struct has unnamed fields"))
|
||||
.with_attrs(field.node.attrs.iter().cloned())
|
||||
builder.struct_field(field.ident.expect("struct has unnamed fields"))
|
||||
.with_attrs(field.attrs.iter().cloned())
|
||||
.ty()
|
||||
.ref_()
|
||||
.lifetime("'__serde_variant")
|
||||
.build_ty(field.node.ty.clone())
|
||||
.build_ty(field.ty.clone())
|
||||
})
|
||||
)
|
||||
.field("__serde_container_ty")
|
||||
@@ -520,7 +520,7 @@ fn serialize_struct_variant(
|
||||
.zip(field_names.iter())
|
||||
.map(|(field, field_name)| {
|
||||
(
|
||||
field.node.ident().expect("struct has unnamed fields"),
|
||||
field.ident.expect("struct has unnamed fields"),
|
||||
builder.expr().id(field_name),
|
||||
)
|
||||
})
|
||||
@@ -656,7 +656,7 @@ fn serialize_struct_visitor(
|
||||
.filter(|&(_, ref field_attr)| !field_attr.skip_serializing_field())
|
||||
.enumerate()
|
||||
.map(|(i, (ref field, ref field_attr))| {
|
||||
let name = field.node.ident().expect("struct has unnamed field");
|
||||
let name = field.ident.expect("struct has unnamed field");
|
||||
|
||||
let key_expr = field_attr.name().serialize_name_expr();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user