diff --git a/Cargo.lock b/Cargo.lock index 24888b6486a0..c662ca56b3db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -850,34 +850,33 @@ dependencies = [ [[package]] name = "darling" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_core 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_macro 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "darling_core" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ident_case 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "darling_macro" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_core 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -911,8 +910,8 @@ dependencies = [ name = "deny_public_fields" version = "0.0.1" dependencies = [ - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -936,11 +935,11 @@ dependencies = [ name = "derive_common" version = "0.0.1" dependencies = [ - "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "darling 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1029,17 +1028,17 @@ dependencies = [ name = "dom_struct" version = "0.0.1" dependencies = [ - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "domobject_derive" version = "0.0.1" dependencies = [ - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2246,9 +2245,9 @@ dependencies = [ name = "jstraceable_derive" version = "0.0.1" dependencies = [ - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4432,9 +4431,9 @@ name = "servo_config_plugins" version = "0.0.1" dependencies = [ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4777,12 +4776,12 @@ dependencies = [ name = "style_derive" version = "0.0.1" dependencies = [ - "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "darling 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "derive_common 0.0.1", - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4874,6 +4873,17 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "synstructure" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -5006,12 +5016,12 @@ dependencies = [ name = "to_shmem_derive" version = "0.0.1" dependencies = [ - "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "darling 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "derive_common 0.0.1", - "proc-macro2 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5945,9 +5955,9 @@ dependencies = [ "checksum cstr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "19f7a08ed4ecd7e077d4cee63937473e6f7cf57b702a9114ef41751b2cbc0f60" "checksum cstr-macros 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cd670e5ff58768ef624207fb95709ce63b8d05573fb9a05165f0eef471ea6a3a" "checksum ctor 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3e061727ebef83bbccac7c27b9a5ff9fd83094d34cb20f4005440a9562a27de7" -"checksum darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6" -"checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c" -"checksum darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d8dac1c6f1d29a41c4712b4400f878cb4fcc4c7628f298dd75038e024998d1" +"checksum darling 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe629a532efad5526454efb0700f86d5ad7ff001acb37e431c8bf017a432a8e" +"checksum darling_core 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ee54512bec54b41cf2337a22ddfadb53c7d4c738494dc2a186d7b037ad683b85" +"checksum darling_macro 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cd3e432e52c0810b72898296a69d66b1d78d1517dff6cde7a130557a55a62c1" "checksum dbus 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3d975a175aa2dced1a6cd410b89a1bf23918f301eab2b6f7c5e608291b757639" "checksum deflate 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6abb26e16e8d419b5c78662aa9f82857c2386a073da266840e474d5055ec86" "checksum derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6073e9676dbebdddeabaeb63e3b7cefd23c86f5c41d381ee1237cc77b1079898" @@ -6245,6 +6255,7 @@ dependencies = [ "checksum syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c" "checksum syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "158521e6f544e7e3dcfc370ac180794aa38cb34a1b1e07609376d4adcf429b93" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" +"checksum synstructure 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "affc27d5f1764f7487bafeb41e380664790716e38ba45d8487bddcc53e79f0f6" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum tempfile 3.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7dc4738f2e68ed2855de5ac9cdbe05c9216773ecde4739b2f095002ab03a13ef" "checksum tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "707feda9f2582d5d680d733e38755547a3e8fb471e7ba11452ecfd9ce93a5d3b" diff --git a/components/config_plugins/Cargo.toml b/components/config_plugins/Cargo.toml index 24e0fb5d865e..3399e907039f 100644 --- a/components/config_plugins/Cargo.toml +++ b/components/config_plugins/Cargo.toml @@ -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" diff --git a/components/config_plugins/lib.rs b/components/config_plugins/lib.rs index b93542d737bd..bd2ae2ca6e5d 100644 --- a/components/config_plugins/lib.rs +++ b/components/config_plugins/lib.rs @@ -196,15 +196,15 @@ impl Field { fn attr_to_pref_name(attr: &Attribute) -> Option { 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()); } } diff --git a/components/deny_public_fields/Cargo.toml b/components/deny_public_fields/Cargo.toml index 18045cd1fd3b..36141af57b2b 100644 --- a/components/deny_public_fields/Cargo.toml +++ b/components/deny_public_fields/Cargo.toml @@ -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" diff --git a/components/derive_common/Cargo.toml b/components/derive_common/Cargo.toml index bf0bb9a90140..411219810de3 100644 --- a/components/derive_common/Cargo.toml +++ b/components/derive_common/Cargo.toml @@ -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" diff --git a/components/dom_struct/Cargo.toml b/components/dom_struct/Cargo.toml index 9a56a6e6c382..211ad92cbb00 100644 --- a/components/dom_struct/Cargo.toml +++ b/components/dom_struct/Cargo.toml @@ -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" diff --git a/components/dom_struct/lib.rs b/components/dom_struct/lib.rs index 59a3cf8072c5..f316a6f22bb7 100644 --- a/components/dom_struct/lib.rs +++ b/components/dom_struct/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; diff --git a/components/domobject_derive/Cargo.toml b/components/domobject_derive/Cargo.toml index cde45a52023e..dcf99046daf2 100644 --- a/components/domobject_derive/Cargo.toml +++ b/components/domobject_derive/Cargo.toml @@ -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" diff --git a/components/jstraceable_derive/Cargo.toml b/components/jstraceable_derive/Cargo.toml index 86bd933e7628..452d1833a3bf 100644 --- a/components/jstraceable_derive/Cargo.toml +++ b/components/jstraceable_derive/Cargo.toml @@ -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" diff --git a/components/style_derive/Cargo.toml b/components/style_derive/Cargo.toml index a59a9b536124..af8fa41aa75c 100644 --- a/components/style_derive/Cargo.toml +++ b/components/style_derive/Cargo.toml @@ -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" diff --git a/components/style_derive/animate.rs b/components/style_derive/animate.rs index 16c3ee122722..4d8581a8f2bd 100644 --- a/components/style_derive/animate.rs +++ b/components/style_derive/animate.rs @@ -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, + pub no_bound: Option, } #[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, + pub no_bound: Option, } #[darling(attributes(animation), default)] diff --git a/components/style_derive/compute_squared_distance.rs b/components/style_derive/compute_squared_distance.rs index 68c8fdec4c55..9c5f7ec80d1b 100644 --- a/components/style_derive/compute_squared_distance.rs +++ b/components/style_derive/compute_squared_distance.rs @@ -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), diff --git a/components/style_derive/to_animated_zero.rs b/components/style_derive/to_animated_zero.rs index 6f0c2fe7ff24..008e94cbcfb0 100644 --- a/components/style_derive/to_animated_zero.rs +++ b/components/style_derive/to_animated_zero.rs @@ -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), diff --git a/components/to_shmem_derive/Cargo.toml b/components/to_shmem_derive/Cargo.toml index 9b16ca5e8771..1ddb0974d7ce 100644 --- a/components/to_shmem_derive/Cargo.toml +++ b/components/to_shmem_derive/Cargo.toml @@ -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" diff --git a/servo-tidy.toml b/servo-tidy.toml index 80897ef583d1..fc4921c451a1 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -36,6 +36,7 @@ packages = [ "quote", "rand_core", "syn", + "synstructure", "unicode-xid", ] # Files that are ignored for all tidy and lint checks.