mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Bump all in-tree components to syn 1
This commit is contained in:
parent
2d823d7721
commit
99ef7813f2
15 changed files with 94 additions and 86 deletions
|
@ -12,7 +12,7 @@ proc-macro = true
|
|||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
syn = { version = "0.15", default-features = false, features = ["clone-impls", "parsing"] }
|
||||
quote = "0.6"
|
||||
proc-macro2 = "0.4"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "parsing"] }
|
||||
quote = "1"
|
||||
proc-macro2 = "1"
|
||||
itertools = "0.8"
|
||||
|
|
|
@ -196,15 +196,15 @@ impl Field {
|
|||
|
||||
fn attr_to_pref_name(attr: &Attribute) -> Option<LitStr> {
|
||||
attr.parse_meta().ok().and_then(|meta| {
|
||||
if let Meta::List(MetaList { ident, nested, .. }) = meta {
|
||||
if ident.to_string() == "serde" {
|
||||
if let Meta::List(MetaList { path, nested, .. }) = meta {
|
||||
if path.is_ident("serde") {
|
||||
if let Some(NestedMeta::Meta(Meta::NameValue(MetaNameValue {
|
||||
ref ident,
|
||||
ref path,
|
||||
lit: Lit::Str(val),
|
||||
..
|
||||
}))) = nested.iter().next()
|
||||
{
|
||||
if ident.to_string() == "rename" {
|
||||
if path.is_ident("rename") {
|
||||
return Some(val.clone());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@ path = "lib.rs"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = { version = "0.15", default-features = false, features = ["derive", "parsing"] }
|
||||
synstructure = "0.10"
|
||||
syn = { version = "1", default-features = false, features = ["derive", "parsing"] }
|
||||
synstructure = "0.12"
|
||||
|
|
|
@ -9,8 +9,8 @@ publish = false
|
|||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
darling = "0.9"
|
||||
proc-macro2 = "0.4"
|
||||
quote = "0.6"
|
||||
syn = { version = "0.15", default-features = false, features = ["clone-impls", "parsing"] }
|
||||
synstructure = "0.10"
|
||||
darling = { version = "0.10", default-features = false }
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "parsing"] }
|
||||
synstructure = "0.12"
|
||||
|
|
|
@ -6,8 +6,8 @@ publish = false
|
|||
version = "0.0.1"
|
||||
|
||||
[dependencies]
|
||||
quote = "0.6.3"
|
||||
syn = { version = "0.15", default-features = false, features = ["clone-impls", "parsing"] }
|
||||
quote = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "parsing"] }
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
|
|
@ -35,11 +35,7 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||
return quote!(#s2).into();
|
||||
}
|
||||
if let Fields::Named(ref f) = s.fields {
|
||||
let f = f
|
||||
.named
|
||||
.first()
|
||||
.expect("Must have at least one field")
|
||||
.into_value();
|
||||
let f = f.named.first().expect("Must have at least one field");
|
||||
let ident = f.ident.as_ref().expect("Must have named fields");
|
||||
let name = &s.ident;
|
||||
let ty = &f.ty;
|
||||
|
|
|
@ -11,6 +11,6 @@ path = "lib.rs"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4"
|
||||
syn = { version = "0.15", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
quote = "0.6"
|
||||
proc-macro2 = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
quote = "1"
|
||||
|
|
|
@ -11,6 +11,6 @@ path = "lib.rs"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4"
|
||||
syn = { version = "0.15", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
synstructure = "0.10"
|
||||
proc-macro2 = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
synstructure = "0.12"
|
||||
|
|
|
@ -10,9 +10,9 @@ path = "lib.rs"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
darling = "0.9"
|
||||
darling = { version = "0.10", default-features = false }
|
||||
derive_common = { path = "../derive_common" }
|
||||
proc-macro2 = "0.4"
|
||||
quote = "0.6"
|
||||
syn = { version = "0.15", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
synstructure = "0.10"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
synstructure = "0.12"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use darling::util::IdentList;
|
||||
use darling::util::PathList;
|
||||
use derive_common::cg;
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::TokenStreamExt;
|
||||
|
@ -14,7 +14,7 @@ pub fn derive(mut input: DeriveInput) -> TokenStream {
|
|||
let no_bound = animation_input_attrs.no_bound.unwrap_or_default();
|
||||
let mut where_clause = input.generics.where_clause.take();
|
||||
for param in input.generics.type_params() {
|
||||
if !no_bound.contains(¶m.ident) {
|
||||
if !no_bound.iter().any(|name| name.is_ident(¶m.ident)) {
|
||||
cg::add_predicate(
|
||||
&mut where_clause,
|
||||
parse_quote!(#param: crate::values::animated::Animate),
|
||||
|
@ -124,7 +124,7 @@ struct AnimateInputAttrs {
|
|||
#[darling(attributes(animation), default)]
|
||||
#[derive(Default, FromDeriveInput)]
|
||||
pub struct AnimationInputAttrs {
|
||||
pub no_bound: Option<IdentList>,
|
||||
pub no_bound: Option<PathList>,
|
||||
}
|
||||
|
||||
#[darling(attributes(animation), default)]
|
||||
|
@ -133,7 +133,7 @@ pub struct AnimationVariantAttrs {
|
|||
pub error: bool,
|
||||
// Only here because of structs, where the struct definition acts as a
|
||||
// variant itself.
|
||||
pub no_bound: Option<IdentList>,
|
||||
pub no_bound: Option<PathList>,
|
||||
}
|
||||
|
||||
#[darling(attributes(animation), default)]
|
||||
|
|
|
@ -14,7 +14,7 @@ pub fn derive(mut input: DeriveInput) -> TokenStream {
|
|||
let no_bound = animation_input_attrs.no_bound.unwrap_or_default();
|
||||
let mut where_clause = input.generics.where_clause.take();
|
||||
for param in input.generics.type_params() {
|
||||
if !no_bound.contains(¶m.ident) {
|
||||
if !no_bound.iter().any(|name| name.is_ident(¶m.ident)) {
|
||||
cg::add_predicate(
|
||||
&mut where_clause,
|
||||
parse_quote!(#param: crate::values::distance::ComputeSquaredDistance),
|
||||
|
|
|
@ -14,7 +14,7 @@ pub fn derive(mut input: syn::DeriveInput) -> TokenStream {
|
|||
let no_bound = animation_input_attrs.no_bound.unwrap_or_default();
|
||||
let mut where_clause = input.generics.where_clause.take();
|
||||
for param in input.generics.type_params() {
|
||||
if !no_bound.contains(¶m.ident) {
|
||||
if !no_bound.iter().any(|name| name.is_ident(¶m.ident)) {
|
||||
cg::add_predicate(
|
||||
&mut where_clause,
|
||||
parse_quote!(#param: crate::values::animated::ToAnimatedZero),
|
||||
|
|
|
@ -10,9 +10,9 @@ path = "lib.rs"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
darling = "0.9"
|
||||
darling = { version = "0.10", default-features = false }
|
||||
derive_common = { path = "../derive_common" }
|
||||
proc-macro2 = "0.4"
|
||||
quote = "0.6"
|
||||
syn = { version = "0.15", default-features = false, features = ["derive", "parsing"] }
|
||||
synstructure = "0.10"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "1", default-features = false, features = ["derive", "parsing"] }
|
||||
synstructure = "0.12"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue