Remove use of Span::located_at
This commit is contained in:
parent
801fd1dc19
commit
d82a0cc5ff
@ -549,7 +549,7 @@ fn deserialize_seq(
|
||||
let visit = match field.attrs.deserialize_with() {
|
||||
None => {
|
||||
let field_ty = &field.ty;
|
||||
let span = Span::call_site().located_at(field.original.span());
|
||||
let span = field.original.span();
|
||||
let func = quote_spanned!(span=> _serde::de::SeqAccess::next_element::<#field_ty>);
|
||||
quote!(try!(#func(&mut __seq)))
|
||||
}
|
||||
@ -2193,7 +2193,7 @@ fn deserialize_map(
|
||||
let visit = match field.attrs.deserialize_with() {
|
||||
None => {
|
||||
let field_ty = &field.ty;
|
||||
let span = Span::call_site().located_at(field.original.span());
|
||||
let span = field.original.span();
|
||||
let func = quote_spanned!(span=> _serde::de::MapAccess::next_value::<#field_ty>);
|
||||
quote! {
|
||||
try!(#func(&mut __map))
|
||||
@ -2638,7 +2638,7 @@ fn expr_is_missing(field: &Field, cattrs: &attr::Container) -> Fragment {
|
||||
let name = field.attrs.name().deserialize_name();
|
||||
match field.attrs.deserialize_with() {
|
||||
None => {
|
||||
let span = Span::call_site().located_at(field.original.span());
|
||||
let span = field.original.span();
|
||||
let func = quote_spanned!(span=> _serde::private::de::missing_field);
|
||||
quote_expr! {
|
||||
try!(#func(#name))
|
||||
|
@ -212,7 +212,7 @@ fn serialize_newtype_struct(
|
||||
field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
|
||||
}
|
||||
|
||||
let span = Span::call_site().located_at(field.original.span());
|
||||
let span = field.original.span();
|
||||
let func = quote_spanned!(span=> _serde::Serializer::serialize_newtype_struct);
|
||||
quote_expr! {
|
||||
#func(__serializer, #type_name, #field_expr)
|
||||
@ -880,7 +880,7 @@ fn serialize_tuple_struct_visitor(
|
||||
field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
|
||||
}
|
||||
|
||||
let span = Span::call_site().located_at(field.original.span());
|
||||
let span = field.original.span();
|
||||
let func = tuple_trait.serialize_element(span);
|
||||
let ser = quote! {
|
||||
try!(#func(&mut __serde_state, #field_expr));
|
||||
@ -923,7 +923,7 @@ fn serialize_struct_visitor(
|
||||
field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
|
||||
}
|
||||
|
||||
let span = Span::call_site().located_at(field.original.span());
|
||||
let span = field.original.span();
|
||||
let ser = if field.attrs.flatten() {
|
||||
quote! {
|
||||
try!(_serde::Serialize::serialize(&#field_expr, _serde::private::ser::FlatMapSerializer(&mut __serde_state)));
|
||||
|
Loading…
Reference in New Issue
Block a user