No bug - Revendor rust dependencies
authorServo VCS Sync <servo-vcs-sync@mozilla.com>
Sat, 20 May 2017 18:45:20 +0000
changeset 359775 ed2b154ae61ff25f42e6b94bb435f9d20ea20a4c
parent 359774 f30e76c54839cc7c7635be21c104580fb593602d
child 359776 57944331d42935841ae4455a50efa5d93e076b03
push id31857
push userphilringnalda@gmail.com
push dateSun, 21 May 2017 20:00:29 +0000
treeherdermozilla-central@cf9f9525e4d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug - Revendor rust dependencies
third_party/rust/synstructure/.cargo-checksum.json
third_party/rust/synstructure/.cargo-ok
third_party/rust/synstructure/.gitignore
third_party/rust/synstructure/.travis.yml
third_party/rust/synstructure/Cargo.toml
third_party/rust/synstructure/README.md
third_party/rust/synstructure/src/lib.rs
third_party/rust/synstructure/tests/alt_prefix.rs
toolkit/library/gtest/rust/Cargo.lock
toolkit/library/rust/Cargo.lock
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/.cargo-checksum.json
@@ -0,0 +1,1 @@
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"d4bc1060351bd12aeb098af93bf7e0f9a057304a1c69ab4c9bdce2bc8cf383c4","Cargo.toml":"acba6e4f3b0e27642e96f9ea1d0d88009d615400e97a65d7381f0345a57ff50d","README.md":"cf1d7d2a7b7dd08ed97ba974ca56246ebb32e6d824b5598468e5c52a3094f31a","src/lib.rs":"923247477fbb41735a02592c19eaf9548cd2f9a6a61bd4ac46d788cd8996650e","tests/alt_prefix.rs":"7978ed607cd44d31bf8329cab2d959c7dfb44f791d28bb0bfd2d11149954c809"},"package":"cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c"}
\ No newline at end of file
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/.gitignore
@@ -0,0 +1,2 @@
+target
+Cargo.lock
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/.travis.yml
@@ -0,0 +1,7 @@
+language: rust
+rust:
+- nightly
+sudo: false
+notifications:
+  email:
+    on_success: never
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/Cargo.toml
@@ -0,0 +1,16 @@
+[package]
+name = "synstructure"
+version = "0.5.2"
+authors = ["Michael Layzell <michael@thelayzells.com>"]
+
+description = "expand_substructure-like helpers for syn macros 1.1 derive macros"
+documentation = "https://docs.rs/synstructure"
+repository = "https://github.com/mystor/synstructure"
+readme = "README.md"
+license = "MIT"
+keywords = ["syn", "macros", "derive", "expand_substructure", "enum"]
+
+
+[dependencies]
+syn = "0.11"
+quote = "0.3"
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/README.md
@@ -0,0 +1,51 @@
+# synstructure
+
+> NOTE: What follows is an exerpt from the module level documentation. For full
+> details read the docs on [docs.rs](https://docs.rs/synstructure/)
+
+This crate provides helper methods for matching against enum variants, and
+extracting bindings to each of the fields in the deriving Struct or Enum in
+a generic way.
+
+If you are writing a `#[derive]` which needs to perform some operation on every
+field, then you have come to the right place!
+
+## Example Usage
+
+```rust
+extern crate syn;
+extern crate synstructure;
+#[macro_use]
+extern crate quote;
+use synstructure::{each_field, BindStyle};
+
+type TokenStream = String; // XXX: Dummy to not depend on rustc_macro
+
+fn sum_fields_derive(input: TokenStream) -> TokenStream {
+    let source = input.to_string();
+    let ast = syn::parse_macro_input(&source).unwrap();
+
+    let match_body = each_field(&ast, &BindStyle::Ref.into(), |bi| quote! {
+        sum += #bi as i64;
+    });
+
+    let name = &ast.ident;
+    let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl();
+    let result = quote! {
+        impl #impl_generics ::sum_fields::SumFields for #name #ty_generics #where_clause {
+            fn sum_fields(&self) -> i64 {
+                let mut sum = 0i64;
+                match *self { #match_body }
+                sum
+            }
+        }
+    };
+
+    result.to_string().parse().unwrap()
+}
+
+fn main() {}
+```
+
+For more example usage, consider investigating the `abomonation_derive` crate,
+which makes use of this crate, and is fairly simple.
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/src/lib.rs
@@ -0,0 +1,373 @@
+//! This crate provides helper methods for matching against enum variants, and
+//! extracting bindings to each of the fields in the deriving Struct or Enum in
+//! a generic way.
+//!
+//! If you are writing a `#[derive]` which needs to perform some operation on
+//! every field, then you have come to the right place!
+//!
+//! # Example
+//!
+//! ```
+//! extern crate syn;
+//! extern crate synstructure;
+//! #[macro_use]
+//! extern crate quote;
+//! extern crate proc_macro;
+//!
+//! use synstructure::{each_field, BindStyle};
+//! use proc_macro::TokenStream;
+//!
+//! fn sum_fields_derive(input: TokenStream) -> TokenStream {
+//!     let source = input.to_string();
+//!     let ast = syn::parse_macro_input(&source).unwrap();
+//!
+//!     let match_body = each_field(&ast, &BindStyle::Ref.into(), |bi| quote! {
+//!         sum += #bi as i64;
+//!     });
+//!
+//!     let name = &ast.ident;
+//!     let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl();
+//!     let result = quote! {
+//!         impl #impl_generics ::sum_fields::SumFields for #name #ty_generics #where_clause {
+//!             fn sum_fields(&self) -> i64 {
+//!                 let mut sum = 0i64;
+//!                 match *self { #match_body }
+//!                 sum
+//!             }
+//!         }
+//!     };
+//!
+//!     result.to_string().parse().unwrap()
+//! }
+//! #
+//! # fn main() {}
+//! ```
+//!
+//! For more example usage, consider investigating the `abomonation_derive` crate,
+//! which makes use of this crate, and is fairly simple.
+
+extern crate syn;
+#[macro_use]
+extern crate quote;
+
+use std::borrow::Cow;
+use syn::{Body, Field, Ident, MacroInput, VariantData, Variant};
+use quote::{Tokens, ToTokens};
+
+/// The type of binding to use when generating a pattern.
+#[derive(Debug, Copy, Clone)]
+pub enum BindStyle {
+    /// `x`
+    Move,
+    /// `mut x`
+    MoveMut,
+    /// `ref x`
+    Ref,
+    /// `ref mut x`
+    RefMut,
+}
+
+impl ToTokens for BindStyle {
+    fn to_tokens(&self, tokens: &mut Tokens) {
+        match *self {
+            BindStyle::Move => {}
+            BindStyle::MoveMut => tokens.append("mut"),
+            BindStyle::Ref => tokens.append("ref"),
+            BindStyle::RefMut => {
+                tokens.append("ref");
+                tokens.append("mut");
+            }
+        }
+    }
+}
+
+/// Binding options to use when generating a pattern.
+/// Configuration options used for generating binding patterns.
+///
+/// `bind_style` controls the type of binding performed in the pattern, for
+/// example: `ref` or `ref mut`.
+///
+/// `prefix` controls the name which is used for the binding. This can be used
+/// to avoid name conflicts with nested match patterns.
+#[derive(Debug, Clone)]
+pub struct BindOpts {
+    bind_style: BindStyle,
+    prefix: Cow<'static, str>,
+}
+
+impl BindOpts {
+    /// Create a BindOpts with the given style, and the default prefix: "__binding".
+    pub fn new(bind_style: BindStyle) -> BindOpts {
+        BindOpts {
+            bind_style: bind_style,
+            prefix: "__binding".into(),
+        }
+    }
+
+    /// Create a BindOpts with the given style and prefix.
+    pub fn with_prefix(bind_style: BindStyle, prefix: String) -> BindOpts {
+        BindOpts {
+            bind_style: bind_style,
+            prefix: prefix.into(),
+        }
+    }
+}
+
+impl From<BindStyle> for BindOpts {
+    fn from(style: BindStyle) -> Self {
+        BindOpts::new(style)
+    }
+}
+
+/// Information about a specific binding. This contains both an `Ident`
+/// reference to the given field, and the syn `&'a Field` descriptor for that
+/// field.
+///
+/// This type supports `quote::ToTokens`, so can be directly used within the
+/// `quote!` macro. It expands to a reference to the matched field.
+#[derive(Debug)]
+pub struct BindingInfo<'a> {
+    pub ident: Ident,
+    pub field: &'a Field,
+}
+
+impl<'a> ToTokens for BindingInfo<'a> {
+    fn to_tokens(&self, tokens: &mut Tokens) {
+        self.ident.to_tokens(tokens);
+    }
+}
+
+/// Generate a match pattern for binding to the given VariantData This function
+/// returns a tuple of the tokens which make up that match pattern, and a
+/// `BindingInfo` object for each of the bindings which were made. The `bind`
+/// parameter controls the type of binding which is made.
+///
+/// # Example
+///
+/// ```
+/// extern crate syn;
+/// extern crate synstructure;
+/// #[macro_use]
+/// extern crate quote;
+/// use synstructure::{match_pattern, BindStyle};
+///
+/// fn main() {
+///     let ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap();
+///     let vd = if let syn::Body::Struct(ref vd) = ast.body {
+///         vd
+///     } else { unreachable!() };
+///
+///     let (tokens, bindings) = match_pattern(&ast.ident, vd, &BindStyle::Ref.into());
+///     assert_eq!(tokens.to_string(), quote! {
+///          A{ a: ref __binding_0, b: ref __binding_1, }
+///     }.to_string());
+///     assert_eq!(bindings.len(), 2);
+///     assert_eq!(&bindings[0].ident.to_string(), "__binding_0");
+///     assert_eq!(&bindings[1].ident.to_string(), "__binding_1");
+/// }
+/// ```
+pub fn match_pattern<'a, N: ToTokens>(name: &N,
+                                      vd: &'a VariantData,
+                                      options: &BindOpts)
+                                      -> (Tokens, Vec<BindingInfo<'a>>) {
+    let mut t = Tokens::new();
+    let mut matches = Vec::new();
+
+    let binding = options.bind_style;
+    name.to_tokens(&mut t);
+    match *vd {
+        VariantData::Unit => {}
+        VariantData::Tuple(ref fields) => {
+            t.append("(");
+            for (i, field) in fields.iter().enumerate() {
+                let ident: Ident = format!("{}_{}", options.prefix, i).into();
+                quote!(#binding #ident ,).to_tokens(&mut t);
+                matches.push(BindingInfo {
+                    ident: ident,
+                    field: field,
+                });
+            }
+            t.append(")");
+        }
+        VariantData::Struct(ref fields) => {
+            t.append("{");
+            for (i, field) in fields.iter().enumerate() {
+                let ident: Ident = format!("{}_{}", options.prefix, i).into();
+                {
+                    let field_name = field.ident.as_ref().unwrap();
+                    quote!(#field_name : #binding #ident ,).to_tokens(&mut t);
+                }
+                matches.push(BindingInfo {
+                    ident: ident,
+                    field: field,
+                });
+            }
+            t.append("}");
+        }
+    }
+
+    (t, matches)
+}
+
+/// This method calls `func` once per variant in the struct or enum, and generates
+/// a series of match branches which will destructure a the input, and run the result
+/// of `func` once for each of the variants.
+///
+/// The second argument to `func` is a syn `Variant` object. This object is
+/// fabricated for struct-like `MacroInput` parameters.
+///
+/// # Example
+///
+/// ```
+/// extern crate syn;
+/// extern crate synstructure;
+/// #[macro_use]
+/// extern crate quote;
+/// use synstructure::{each_variant, BindStyle};
+///
+/// fn main() {
+///     let mut ast = syn::parse_macro_input("enum A { B(i32, i32), C }").unwrap();
+///
+///     let tokens = each_variant(&mut ast, &BindStyle::Ref.into(), |bindings, variant| {
+///         let name_str = variant.ident.as_ref();
+///         if name_str == "B" {
+///             assert_eq!(bindings.len(), 2);
+///             assert_eq!(bindings[0].ident.as_ref(), "__binding_0");
+///             assert_eq!(bindings[1].ident.as_ref(), "__binding_1");
+///         } else {
+///             assert_eq!(name_str, "C");
+///             assert_eq!(bindings.len(), 0);
+///         }
+///         quote!(#name_str)
+///     });
+///     assert_eq!(tokens.to_string(), quote! {
+///         A::B(ref __binding_0, ref __binding_1,) => { "B" }
+///         A::C => { "C" }
+///     }.to_string());
+/// }
+/// ```
+pub fn each_variant<F, T: ToTokens>(input: &MacroInput,
+                                    options: &BindOpts,
+                                    mut func: F)
+                                    -> Tokens
+    where F: FnMut(Vec<BindingInfo>, &Variant) -> T {
+    let ident = &input.ident;
+
+    let struct_variant;
+    // Generate patterns for matching against all of the variants
+    let variants = match input.body {
+        Body::Enum(ref variants) => {
+            variants.iter()
+                .map(|variant| {
+                    let variant_ident = &variant.ident;
+                    let (pat, bindings) = match_pattern(&quote!(#ident :: #variant_ident),
+                                                        &variant.data,
+                                                        options);
+                    (pat, bindings, variant)
+                })
+                .collect()
+        }
+        Body::Struct(ref vd) => {
+            struct_variant = Variant {
+                ident: ident.clone(),
+                attrs: input.attrs.clone(),
+                data: vd.clone(),
+                discriminant: None,
+            };
+
+            let (pat, bindings) = match_pattern(&ident, &vd, options);
+            vec![(pat, bindings, &struct_variant)]
+        }
+    };
+
+    // Now that we have the patterns, generate the actual branches of the match
+    // expression
+    let mut t = Tokens::new();
+    for (pat, bindings, variant) in variants {
+        let body = func(bindings, variant);
+        quote!(#pat => { #body }).to_tokens(&mut t);
+    }
+
+    t
+}
+
+/// This method generates a match branch for each of the substructures of the
+/// given `MacroInput`. It will call `func` for each of these substructures,
+/// passing in the bindings which were made for each of the fields in the
+/// substructure. The return value of `func` is then used as the value of each
+/// branch
+///
+/// # Example
+///
+/// ```
+/// extern crate syn;
+/// extern crate synstructure;
+/// #[macro_use]
+/// extern crate quote;
+/// use synstructure::{match_substructs, BindStyle};
+///
+/// fn main() {
+///     let mut ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap();
+///
+///     let tokens = match_substructs(&mut ast, &BindStyle::Ref.into(), |bindings| {
+///         assert_eq!(bindings.len(), 2);
+///         assert_eq!(bindings[0].ident.as_ref(), "__binding_0");
+///         assert_eq!(bindings[1].ident.as_ref(), "__binding_1");
+///         quote!("some_random_string")
+///     });
+///     assert_eq!(tokens.to_string(), quote! {
+///         A { a: ref __binding_0, b: ref __binding_1, } => { "some_random_string" }
+///     }.to_string());
+/// }
+/// ```
+pub fn match_substructs<F, T: ToTokens>(input: &MacroInput,
+                                        options: &BindOpts,
+                                        mut func: F)
+                                        -> Tokens
+    where F: FnMut(Vec<BindingInfo>) -> T
+{
+    each_variant(input, options, |bindings, _| func(bindings))
+}
+
+/// This method calls `func` once per field in the struct or enum, and generates
+/// a series of match branches which will destructure match argument, and run
+/// the result of `func` once on each of the bindings.
+///
+/// # Example
+///
+/// ```
+/// extern crate syn;
+/// extern crate synstructure;
+/// #[macro_use]
+/// extern crate quote;
+/// use synstructure::{each_field, BindStyle};
+///
+/// fn main() {
+///     let mut ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap();
+///
+///     let tokens = each_field(&mut ast, &BindStyle::Ref.into(), |bi| quote! {
+///         println!("Saw: {:?}", #bi);
+///     });
+///     assert_eq!(tokens.to_string(), quote! {
+///         A{ a: ref __binding_0, b: ref __binding_1, } => {
+///             { println!("Saw: {:?}", __binding_0); }
+///             { println!("Saw: {:?}", __binding_1); }
+///             ()
+///         }
+///     }.to_string());
+/// }
+/// ```
+pub fn each_field<F, T: ToTokens>(input: &MacroInput, options: &BindOpts, mut func: F) -> Tokens
+    where F: FnMut(BindingInfo) -> T
+{
+    each_variant(input, options, |bindings, _| {
+        let mut t = Tokens::new();
+        for binding in bindings {
+            t.append("{");
+            func(binding).to_tokens(&mut t);
+            t.append("}");
+        }
+        quote!(()).to_tokens(&mut t);
+        t
+    })
+}
new file mode 100644
--- /dev/null
+++ b/third_party/rust/synstructure/tests/alt_prefix.rs
@@ -0,0 +1,22 @@
+extern crate syn;
+extern crate synstructure;
+#[macro_use]
+extern crate quote;
+use synstructure::{match_substructs, BindStyle, BindOpts};
+
+#[test]
+fn alt_prefix() {
+    let ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap();
+
+    let opts = BindOpts::with_prefix(BindStyle::Ref, "__foo".into());
+    let tokens = match_substructs(&ast, &opts, |bindings| {
+        assert_eq!(bindings.len(), 2);
+        assert_eq!(bindings[0].ident.as_ref(), "__foo_0");
+        assert_eq!(bindings[1].ident.as_ref(), "__foo_1");
+        quote!("some_random_string")
+    });
+    let e = quote! {
+        A{ a: ref __foo_0, b: ref __foo_1, } => { "some_random_string" }
+    }.to_string();
+    assert_eq!(tokens.to_string(), e);
+}
--- a/toolkit/library/gtest/rust/Cargo.lock
+++ b/toolkit/library/gtest/rust/Cargo.lock
@@ -825,24 +825,34 @@ dependencies = [
  "ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.18.0",
  "smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "style_derive 0.0.1",
  "style_traits 0.0.1",
  "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "style_derive"
+version = "0.0.1"
+dependencies = [
+ "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "style_traits"
 version = "0.0.1"
 dependencies = [
  "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -860,16 +870,25 @@ dependencies = [
 name = "synom"
 version = "0.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "synstructure"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "syntex"
 version = "0.58.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1192,16 +1211,17 @@ dependencies = [
 "checksum serde 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)" = "05a67b8a53f885f4b6e3ed183806035819f9862474e747fe4488a6d63bcbfcb7"
 "checksum serde_codegen_internals 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d52006899f910528a10631e5b727973fe668f3228109d1707ccf5bad5490b6e"
 "checksum serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f15ea24bd037b2d64646b4d934fa99c649be66e3f7b29fb595a5543b212b1452"
 "checksum siphasher 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ffc669b726f2bc9a3bcff66e5e23b56ba6bf70e22a34c3d7b6d0b3450b65b84"
 "checksum smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4f8266519bc1d17d0b5b16f6c21295625d562841c708f6376f49028a43e9c11e"
 "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
 "checksum syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)" = "37c279fb816210c9bb28b2c292664581e7b87b4561e86b94df462664d8620bb8"
 "checksum synom 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27e31aa4b09b9f4cb12dff3c30ba503e17b1a624413d764d32dab76e3920e5bc"
+"checksum synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c"
 "checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e"
 "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"
 "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"
 "checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"
 "checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989"
 "checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a"
 "checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a"
 "checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7"
--- a/toolkit/library/rust/Cargo.lock
+++ b/toolkit/library/rust/Cargo.lock
@@ -812,24 +812,34 @@ dependencies = [
  "ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.18.0",
  "smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "style_derive 0.0.1",
  "style_traits 0.0.1",
  "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "style_derive"
+version = "0.0.1"
+dependencies = [
+ "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "style_traits"
 version = "0.0.1"
 dependencies = [
  "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -847,16 +857,25 @@ dependencies = [
 name = "synom"
 version = "0.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "synstructure"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "syntex"
 version = "0.58.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1179,16 +1198,17 @@ dependencies = [
 "checksum serde 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)" = "05a67b8a53f885f4b6e3ed183806035819f9862474e747fe4488a6d63bcbfcb7"
 "checksum serde_codegen_internals 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d52006899f910528a10631e5b727973fe668f3228109d1707ccf5bad5490b6e"
 "checksum serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f15ea24bd037b2d64646b4d934fa99c649be66e3f7b29fb595a5543b212b1452"
 "checksum siphasher 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ffc669b726f2bc9a3bcff66e5e23b56ba6bf70e22a34c3d7b6d0b3450b65b84"
 "checksum smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4f8266519bc1d17d0b5b16f6c21295625d562841c708f6376f49028a43e9c11e"
 "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
 "checksum syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)" = "37c279fb816210c9bb28b2c292664581e7b87b4561e86b94df462664d8620bb8"
 "checksum synom 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27e31aa4b09b9f4cb12dff3c30ba503e17b1a624413d764d32dab76e3920e5bc"
+"checksum synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c"
 "checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e"
 "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"
 "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"
 "checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"
 "checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989"
 "checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a"
 "checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a"
 "checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7"