mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #24308 - servo:synful, r=SimonSapin
Update a bunch of stuff to syn 1 This updates a lot of our crates to syn 1. Not all of them, but syn 1 was already in tree so it doesn't matter much either way. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24308) <!-- Reviewable:end -->
This commit is contained in:
commit
25501514bd
26 changed files with 216 additions and 223 deletions
|
@ -20,8 +20,7 @@ getopts = "0.2.11"
|
|||
lazy_static = "1"
|
||||
log = "0.4"
|
||||
num_cpus = "1.1.0"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
servo_geometry = {path = "../geometry"}
|
||||
servo_url = {path = "../url"}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate serde;
|
||||
|
||||
use servo_config::basedir;
|
||||
use servo_config::pref_util::Preferences;
|
||||
|
|
|
@ -12,8 +12,7 @@ proc-macro = true
|
|||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
syn = "0.15"
|
||||
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 = "0.15"
|
||||
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", 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"
|
||||
|
|
|
@ -6,8 +6,8 @@ publish = false
|
|||
version = "0.0.1"
|
||||
|
||||
[dependencies]
|
||||
quote = "0.6.3"
|
||||
syn = { version = "0.15", features = ["full"] }
|
||||
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 = "0.15"
|
||||
quote = "0.6"
|
||||
proc-macro2 = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
quote = "1"
|
||||
|
|
|
@ -56,7 +56,7 @@ servo_allocator = {path = "../allocator"}
|
|||
servo-fontconfig = "0.4"
|
||||
|
||||
[target.'cfg(target_os = "android")'.dependencies]
|
||||
xml5ever = {version = "0.14"}
|
||||
xml5ever = {version = "0.15"}
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
dwrote = "0.9"
|
||||
|
|
|
@ -11,6 +11,6 @@ path = "lib.rs"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4"
|
||||
syn = "0.15"
|
||||
synstructure = "0.10"
|
||||
proc-macro2 = "1"
|
||||
syn = { version = "1", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
synstructure = "0.12"
|
||||
|
|
|
@ -24,7 +24,7 @@ fnv = "1.0"
|
|||
fxhash = "0.2"
|
||||
gfx = {path = "../gfx"}
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
html5ever = "0.23"
|
||||
html5ever = "0.24"
|
||||
ipc-channel = "0.12"
|
||||
lazy_static = "1"
|
||||
libc = "0.2"
|
||||
|
|
|
@ -21,7 +21,7 @@ fxhash = "0.2"
|
|||
gfx = {path = "../gfx"}
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
histogram = "0.6.8"
|
||||
html5ever = "0.23"
|
||||
html5ever = "0.24"
|
||||
ipc-channel = "0.12"
|
||||
layout = {path = "../layout", package = "layout_2013"}
|
||||
layout_traits = {path = "../layout_traits"}
|
||||
|
|
|
@ -21,7 +21,7 @@ fxhash = "0.2"
|
|||
gfx = {path = "../gfx"}
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
histogram = "0.6.8"
|
||||
html5ever = "0.23"
|
||||
html5ever = "0.24"
|
||||
ipc-channel = "0.12"
|
||||
layout = {path = "../layout_2020", package = "layout_2020"}
|
||||
layout_traits = {path = "../layout_traits"}
|
||||
|
|
|
@ -43,5 +43,5 @@ thin-slice = "0.1.0"
|
|||
time = { version = "0.1.17", optional = true }
|
||||
url = { version = "2.0", optional = true }
|
||||
webrender_api = { git = "https://github.com/servo/webrender", features = ["ipc"], optional = true }
|
||||
xml5ever = { version = "0.14", optional = true }
|
||||
xml5ever = { version = "0.15", optional = true }
|
||||
void = "1.0.2"
|
||||
|
|
|
@ -50,11 +50,11 @@ dom_struct = {path = "../dom_struct"}
|
|||
domobject_derive = {path = "../domobject_derive"}
|
||||
embedder_traits = {path = "../embedder_traits"}
|
||||
encoding_rs = "0.8"
|
||||
enum-iterator = "0.2.0"
|
||||
enum-iterator = "0.3"
|
||||
euclid = "0.20"
|
||||
fnv = "1.0"
|
||||
headers = "0.2"
|
||||
html5ever = "0.23"
|
||||
html5ever = "0.24"
|
||||
http = "0.1"
|
||||
hyper = "0.12"
|
||||
hyper_serde = "0.11"
|
||||
|
@ -112,7 +112,7 @@ unicode-segmentation = "1.1.0"
|
|||
url = "2.0"
|
||||
utf-8 = "0.7"
|
||||
uuid = {version = "0.7", features = ["v4"]}
|
||||
xml5ever = {version = "0.14"}
|
||||
xml5ever = {version = "0.15"}
|
||||
webdriver = "0.40"
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
webvr_traits = {path = "../webvr_traits"}
|
||||
|
|
|
@ -18,7 +18,7 @@ cssparser = "0.25"
|
|||
crossbeam-channel = "0.3"
|
||||
euclid = "0.20"
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
html5ever = "0.23"
|
||||
html5ever = "0.24"
|
||||
ipc-channel = "0.12"
|
||||
libc = "0.2"
|
||||
time = "0.1.17"
|
||||
|
|
|
@ -41,7 +41,7 @@ euclid = "0.20"
|
|||
fallible = { path = "../fallible" }
|
||||
fxhash = "0.2"
|
||||
hashglobe = { path = "../hashglobe" }
|
||||
html5ever = {version = "0.23", optional = true}
|
||||
html5ever = {version = "0.24", optional = true}
|
||||
indexmap = "1.0"
|
||||
itertools = "0.8"
|
||||
itoa = "0.4"
|
||||
|
|
|
@ -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(¶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", features = ["visit"] }
|
||||
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