style: Reduce diff with upstream derive_common and malloc_size_of (#31363)

This commit is contained in:
Delan Azabani 2024-02-16 18:24:35 +08:00 committed by GitHub
parent 1e503c3bc1
commit aeb2503fdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 47 additions and 6 deletions

View file

@ -3,7 +3,6 @@ name = "derive_common"
version = "0.0.1" version = "0.0.1"
authors = ["The Servo Project Developers"] authors = ["The Servo Project Developers"]
license = "MPL-2.0" license = "MPL-2.0"
edition = "2018"
publish = false publish = false
[lib] [lib]

View file

@ -4,11 +4,11 @@
use darling::{FromDeriveInput, FromField, FromVariant}; use darling::{FromDeriveInput, FromField, FromVariant};
use proc_macro2::{Span, TokenStream}; use proc_macro2::{Span, TokenStream};
use quote::{quote, TokenStreamExt}; use quote::TokenStreamExt;
use syn::{ use syn::{
self, parse_quote, AngleBracketedGenericArguments, AssocType, DeriveInput, Field, self, AngleBracketedGenericArguments, AssocType, DeriveInput, Field, GenericArgument,
GenericArgument, GenericParam, Ident, Path, PathArguments, PathSegment, QSelf, Type, TypeArray, GenericParam, Ident, Path, PathArguments, PathSegment, QSelf, Type, TypeArray, TypeGroup,
TypeGroup, TypeParam, TypeParen, TypePath, TypeSlice, TypeTuple, Variant, WherePredicate, TypeParam, TypeParen, TypePath, TypeSlice, TypeTuple, Variant, WherePredicate,
}; };
use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo}; use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo};

View file

@ -2,4 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
extern crate darling;
extern crate proc_macro2;
#[macro_use]
extern crate quote;
#[macro_use]
extern crate syn;
extern crate synstructure;
pub mod cg; pub mod cg;

View file

@ -3,7 +3,6 @@ name = "malloc_size_of"
version = "0.0.1" version = "0.0.1"
authors = ["The Servo Project Developers"] authors = ["The Servo Project Developers"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018"
publish = false publish = false
[lib] [lib]

View file

@ -46,6 +46,41 @@
//! Note: WebRender has a reduced fork of this crate, so that we can avoid //! Note: WebRender has a reduced fork of this crate, so that we can avoid
//! publishing this crate on crates.io. //! publishing this crate on crates.io.
#[cfg(feature = "servo")]
extern crate accountable_refcell;
extern crate app_units;
#[cfg(feature = "servo")]
extern crate content_security_policy;
#[cfg(feature = "servo")]
extern crate crossbeam_channel;
extern crate cssparser;
extern crate euclid;
#[cfg(feature = "servo")]
extern crate http;
#[cfg(feature = "servo")]
extern crate keyboard_types;
extern crate selectors;
#[cfg(feature = "servo")]
extern crate serde;
#[cfg(feature = "servo")]
extern crate serde_bytes;
extern crate servo_arc;
extern crate smallbitvec;
extern crate smallvec;
#[cfg(feature = "servo")]
extern crate string_cache;
#[cfg(feature = "servo")]
extern crate time;
#[cfg(feature = "url")]
extern crate url;
#[cfg(feature = "servo")]
extern crate uuid;
extern crate void;
#[cfg(feature = "webrender_api")]
extern crate webrender_api;
#[cfg(feature = "servo")]
extern crate xml5ever;
use std::hash::{BuildHasher, Hash}; use std::hash::{BuildHasher, Hash};
use std::mem::size_of; use std::mem::size_of;
use std::ops::{Deref, DerefMut, Range}; use std::ops::{Deref, DerefMut, Range};