Replace deprecated MacroInput

This commit is contained in:
David Tolnay 2017-01-27 15:42:43 -08:00
parent c0a06bdc96
commit c52e131a03
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ use internals::{self, attr};
use std::iter;
pub fn expand_derive_deserialize(item: &syn::MacroInput) -> Result<Tokens, String> {
pub fn expand_derive_deserialize(item: &syn::DeriveInput) -> Result<Tokens, String> {
let item = {
let ctxt = internals::Ctxt::new();
let item = Item::from_ast(&ctxt, item);

View File

@ -21,7 +21,7 @@ mod ser;
#[proc_macro_derive(Serialize, attributes(serde))]
pub fn derive_serialize(input: TokenStream) -> TokenStream {
let input = syn::parse_macro_input(&input.to_string()).unwrap();
let input = syn::parse_derive_input(&input.to_string()).unwrap();
match ser::expand_derive_serialize(&input) {
Ok(expanded) => expanded.parse().unwrap(),
Err(msg) => panic!(msg),
@ -30,7 +30,7 @@ pub fn derive_serialize(input: TokenStream) -> TokenStream {
#[proc_macro_derive(Deserialize, attributes(serde))]
pub fn derive_deserialize(input: TokenStream) -> TokenStream {
let input = syn::parse_macro_input(&input.to_string()).unwrap();
let input = syn::parse_derive_input(&input.to_string()).unwrap();
match de::expand_derive_deserialize(&input) {
Ok(expanded) => expanded.parse().unwrap(),
Err(msg) => panic!(msg),

View File

@ -5,7 +5,7 @@ use bound;
use internals::ast::{Body, Field, Item, Style, Variant};
use internals::{self, attr};
pub fn expand_derive_serialize(item: &syn::MacroInput) -> Result<Tokens, String> {
pub fn expand_derive_serialize(item: &syn::DeriveInput) -> Result<Tokens, String> {
let ctxt = internals::Ctxt::new();
let item = Item::from_ast(&ctxt, item);
try!(ctxt.check());