Commit 5a6d7ed3 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1587368 - Cherry-pick updates towards syn 1.

From: https://github.com/servo/servo/pull/24308
parent 2c773522
......@@ -9,8 +9,8 @@ publish = false
path = "lib.rs"
[dependencies]
darling = "0.9"
proc-macro2 = "0.4"
quote = "0.6"
syn = { version = "0.15", features = ["visit"] }
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"
......@@ -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", features = ["visit"] }
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(&param.ident) {
if !no_bound.iter().any(|name| name.is_ident(&param.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(&param.ident) {
if !no_bound.iter().any(|name| name.is_ident(&param.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(&param.ident) {
if !no_bound.iter().any(|name| name.is_ident(&param.ident)) {
cg::add_predicate(
&mut where_clause,
parse_quote!(#param: crate::values::animated::ToAnimatedZero),
......
......@@ -10,12 +10,11 @@ name = "to_shmem"
path = "lib.rs"
[features]
servo = ["serde", "cssparser/serde", "string_cache"]
servo = ["cssparser/serde", "string_cache"]
gecko = []
[dependencies]
cssparser = "0.25"
serde = { version = "1.0", optional = true }
servo_arc = { path = "../servo_arc" }
smallbitvec = "2.1.1"
smallvec = "0.6.6"
......
......@@ -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", features = ["visit"] }
synstructure = "0.10"
proc-macro2 = "1"
quote = "1"
syn = { version = "1", default-features = false, features = ["derive", "parsing"] }
synstructure = "0.12"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment