Depend directly on proc_macro2 for Span
The latest version of syn no longer exports the Span type in the way protocol-derive expected. This means that new users will get a compile error saying "could not find `export` in `syn`". By depending on proc_macro2 for the definition of Span, this is easily resolved.
This commit is contained in:
parent
ff7edbb575
commit
41c185fcb1
@ -1,11 +1,10 @@
|
|||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
use proc_macro::TokenStream as TokenStream1;
|
use proc_macro::TokenStream as TokenStream1;
|
||||||
use proc_macro2::Ident;
|
|
||||||
use proc_macro2::TokenStream as TokenStream2;
|
use proc_macro2::TokenStream as TokenStream2;
|
||||||
|
use proc_macro2::{Ident, Span};
|
||||||
use quote::{quote, TokenStreamExt};
|
use quote::{quote, TokenStreamExt};
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
use syn::export::Span;
|
|
||||||
use syn::{parse_macro_input, Data, DeriveInput, Field, Fields, Lit, Meta, NestedMeta};
|
use syn::{parse_macro_input, Data, DeriveInput, Field, Fields, Lit, Meta, NestedMeta};
|
||||||
|
|
||||||
#[proc_macro_derive(Packet, attributes(packet))]
|
#[proc_macro_derive(Packet, attributes(packet))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user