Fix handling of Self keyword in type definition

This commit is contained in:
Taiki Endo
2020-10-24 05:45:12 +09:00
parent f6e7366b46
commit c67017d466
8 changed files with 315 additions and 6 deletions
+6 -2
View File
@@ -8,13 +8,17 @@ use bound;
use dummy;
use fragment::{Expr, Fragment, Match, Stmts};
use internals::ast::{Container, Data, Field, Style, Variant};
use internals::{attr, ungroup, Ctxt, Derive};
use internals::{attr, replace_receiver, ungroup, Ctxt, Derive};
use pretend;
use std::collections::BTreeSet;
use std::ptr;
pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<TokenStream, Vec<syn::Error>> {
pub fn expand_derive_deserialize(
input: &mut syn::DeriveInput,
) -> Result<TokenStream, Vec<syn::Error>> {
replace_receiver(input);
let ctxt = Ctxt::new();
let cont = match Container::from_ast(&ctxt, input, Derive::Deserialize) {
Some(cont) => cont,