mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-26 00:27:56 +00:00
Pretend remote derives are not dead code
This commit is contained in:
@@ -15,6 +15,7 @@ use bound;
|
||||
use fragment::{Fragment, Match, Stmts};
|
||||
use internals::ast::{Container, Data, Field, Style, Variant};
|
||||
use internals::{attr, Ctxt};
|
||||
use pretend;
|
||||
use try;
|
||||
|
||||
use std::u32;
|
||||
@@ -33,11 +34,13 @@ pub fn expand_derive_serialize(input: &syn::DeriveInput) -> Result<Tokens, Strin
|
||||
|
||||
let impl_block = if let Some(remote) = cont.attrs.remote() {
|
||||
let vis = &input.vis;
|
||||
let used = pretend::pretend_used(&cont);
|
||||
quote! {
|
||||
impl #impl_generics #ident #ty_generics #where_clause {
|
||||
#vis fn serialize<__S>(__self: &#remote #ty_generics, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error>
|
||||
where __S: _serde::Serializer
|
||||
{
|
||||
#used
|
||||
#body
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user