mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Fix up whitespace in compiler/rustc_macros/src/serialize.rs
.
This commit is contained in:
parent
39e02f1bd1
commit
2c61c00859
@ -13,7 +13,7 @@ pub fn type_decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
|
|||||||
quote! {}
|
quote! {}
|
||||||
};
|
};
|
||||||
|
|
||||||
s.add_impl_generic(parse_quote! {#decoder_ty: ::rustc_type_ir::codec::TyDecoder #bound });
|
s.add_impl_generic(parse_quote! { #decoder_ty: ::rustc_type_ir::codec::TyDecoder #bound });
|
||||||
s.add_bounds(synstructure::AddBounds::Fields);
|
s.add_bounds(synstructure::AddBounds::Fields);
|
||||||
s.underscore_const(true);
|
s.underscore_const(true);
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ pub fn meta_decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
|
|||||||
|
|
||||||
pub fn decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
pub fn decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
||||||
let decoder_ty = quote! { __D };
|
let decoder_ty = quote! { __D };
|
||||||
s.add_impl_generic(parse_quote! {#decoder_ty: ::rustc_span::SpanDecoder});
|
s.add_impl_generic(parse_quote! { #decoder_ty: ::rustc_span::SpanDecoder });
|
||||||
s.add_bounds(synstructure::AddBounds::Generics);
|
s.add_bounds(synstructure::AddBounds::Generics);
|
||||||
s.underscore_const(true);
|
s.underscore_const(true);
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ pub fn decodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Toke
|
|||||||
|
|
||||||
pub fn decodable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
pub fn decodable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
||||||
let decoder_ty = quote! { __D };
|
let decoder_ty = quote! { __D };
|
||||||
s.add_impl_generic(parse_quote! {#decoder_ty: ::rustc_serialize::Decoder});
|
s.add_impl_generic(parse_quote! { #decoder_ty: ::rustc_serialize::Decoder });
|
||||||
s.add_bounds(synstructure::AddBounds::Generics);
|
s.add_bounds(synstructure::AddBounds::Generics);
|
||||||
s.underscore_const(true);
|
s.underscore_const(true);
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ fn decode_field(field: &syn::Field) -> proc_macro2::TokenStream {
|
|||||||
let __decoder = quote! { __decoder };
|
let __decoder = quote! { __decoder };
|
||||||
// Use the span of the field for the method call, so
|
// Use the span of the field for the method call, so
|
||||||
// that backtraces will point to the field.
|
// that backtraces will point to the field.
|
||||||
quote_spanned! {field_span=> #decode_inner_method(#__decoder) }
|
quote_spanned! { field_span=> #decode_inner_method(#__decoder) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn type_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
pub fn type_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
||||||
@ -133,7 +133,7 @@ pub fn type_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
|
|||||||
};
|
};
|
||||||
|
|
||||||
let encoder_ty = quote! { __E };
|
let encoder_ty = quote! { __E };
|
||||||
s.add_impl_generic(parse_quote! {#encoder_ty: ::rustc_type_ir::codec::TyEncoder #bound });
|
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_type_ir::codec::TyEncoder #bound });
|
||||||
s.add_bounds(synstructure::AddBounds::Fields);
|
s.add_bounds(synstructure::AddBounds::Fields);
|
||||||
s.underscore_const(true);
|
s.underscore_const(true);
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ pub fn type_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
|
|||||||
|
|
||||||
pub fn meta_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
pub fn meta_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
||||||
if !s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
|
if !s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
|
||||||
s.add_impl_generic(parse_quote! {'tcx});
|
s.add_impl_generic(parse_quote! { 'tcx });
|
||||||
}
|
}
|
||||||
s.add_impl_generic(parse_quote! { '__a });
|
s.add_impl_generic(parse_quote! { '__a });
|
||||||
let encoder_ty = quote! { EncodeContext<'__a, 'tcx> };
|
let encoder_ty = quote! { EncodeContext<'__a, 'tcx> };
|
||||||
@ -154,7 +154,7 @@ pub fn meta_encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2:
|
|||||||
|
|
||||||
pub fn encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
pub fn encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
||||||
let encoder_ty = quote! { __E };
|
let encoder_ty = quote! { __E };
|
||||||
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_span::SpanEncoder});
|
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_span::SpanEncoder });
|
||||||
s.add_bounds(synstructure::AddBounds::Generics);
|
s.add_bounds(synstructure::AddBounds::Generics);
|
||||||
s.underscore_const(true);
|
s.underscore_const(true);
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ pub fn encodable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Toke
|
|||||||
|
|
||||||
pub fn encodable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
pub fn encodable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
|
||||||
let encoder_ty = quote! { __E };
|
let encoder_ty = quote! { __E };
|
||||||
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_serialize::Encoder});
|
s.add_impl_generic(parse_quote! { #encoder_ty: ::rustc_serialize::Encoder });
|
||||||
s.add_bounds(synstructure::AddBounds::Generics);
|
s.add_bounds(synstructure::AddBounds::Generics);
|
||||||
s.underscore_const(true);
|
s.underscore_const(true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user