Update to syn 0.15-rc1
This commit is contained in:
parent
d23a40c1bb
commit
98eddf9b29
@ -26,7 +26,7 @@ proc-macro = true
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4"
|
||||
quote = "0.6.3"
|
||||
syn = { version = "0.14", features = ["visit"] }
|
||||
syn-next = { version = "0.15.0-rc1", features = ["visit"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = { version = "1.0", path = "../serde" }
|
||||
|
@ -11,8 +11,8 @@ use proc_macro2::{Group, Span, TokenStream, TokenTree};
|
||||
use std::collections::BTreeSet;
|
||||
use std::str::FromStr;
|
||||
use syn;
|
||||
use syn::parse::{self, Parse, ParseStream};
|
||||
use syn::punctuated::Punctuated;
|
||||
use syn::synom::{ParseError, Synom};
|
||||
use syn::Ident;
|
||||
use syn::Meta::{List, NameValue, Word};
|
||||
use syn::NestedMeta::{Literal, Meta};
|
||||
@ -1300,11 +1300,10 @@ fn parse_lit_into_lifetimes(
|
||||
|
||||
struct BorrowedLifetimes(Punctuated<syn::Lifetime, Token![+]>);
|
||||
|
||||
impl Synom for BorrowedLifetimes {
|
||||
named!(parse -> Self, map!(
|
||||
call!(Punctuated::parse_separated_nonempty),
|
||||
BorrowedLifetimes
|
||||
));
|
||||
impl Parse for BorrowedLifetimes {
|
||||
fn parse(input: ParseStream) -> parse::Result<Self> {
|
||||
Punctuated::parse_separated_nonempty(input).map(BorrowedLifetimes)
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(BorrowedLifetimes(lifetimes)) = parse_lit_str(string) {
|
||||
@ -1513,7 +1512,8 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
|
||||
syn::GenericArgument::Binding(ref binding) => {
|
||||
collect_lifetimes(&binding.ty, out);
|
||||
}
|
||||
syn::GenericArgument::Const(_) => {}
|
||||
syn::GenericArgument::Constraint(_)
|
||||
| syn::GenericArgument::Const(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1535,15 +1535,15 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_lit_str<T>(s: &syn::LitStr) -> Result<T, ParseError>
|
||||
fn parse_lit_str<T>(s: &syn::LitStr) -> parse::Result<T>
|
||||
where
|
||||
T: Synom,
|
||||
T: Parse,
|
||||
{
|
||||
let tokens = try!(spanned_tokens(s));
|
||||
syn::parse2(tokens)
|
||||
}
|
||||
|
||||
fn spanned_tokens(s: &syn::LitStr) -> Result<TokenStream, ParseError> {
|
||||
fn spanned_tokens(s: &syn::LitStr) -> parse::Result<TokenStream> {
|
||||
let stream = try!(syn::parse_str(&s.value()));
|
||||
Ok(respan_token_stream(stream, s.span()))
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4"
|
||||
syn = { version = "0.14", default-features = false, features = ["derive", "parsing", "clone-impls"] }
|
||||
syn-next = { version = "0.15.0-rc1", default-features = false, features = ["derive", "parsing", "clone-impls"] }
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "serde-rs/serde" }
|
||||
|
Loading…
Reference in New Issue
Block a user