From 54ce45f3eeb7c2b3069c093cefa4730484e39463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 26 Aug 2019 23:18:46 +0000 Subject: [PATCH] style: Update cbindgen. This cleans up the pattern of "Use a private dtor so that the helper functions do the right thing" by enabling it everywhere using: https://github.com/eqrion/cbindgen/pull/377 It also caught some uninitialized value issues. I think they're mostly harmless since we zero-initialize our structs: https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/servo/components/style/properties/gecko.mako.rs#632 And since we override the clip rect, which is the other bit of code that was failing to build with this change. Differential Revision: https://phabricator.services.mozilla.com/D43491 --- components/style/values/computed/text.rs | 2 -- components/style/values/generics/effects.rs | 2 -- components/style/values/generics/grid.rs | 8 -------- components/style/values/generics/svg.rs | 5 ----- components/style/values/generics/transform.rs | 1 - components/style/values/generics/url.rs | 2 -- components/style/values/specified/font.rs | 2 -- components/style/values/specified/list.rs | 2 -- components/style/values/specified/motion.rs | 1 - components/style/values/specified/position.rs | 2 -- components/style/values/specified/text.rs | 1 - 11 files changed, 28 deletions(-) diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs index bdb2ac507bc..4cccd248d1c 100644 --- a/components/style/values/computed/text.rs +++ b/components/style/values/computed/text.rs @@ -198,8 +198,6 @@ impl TextDecorationsInEffect { } /// Computed value for the text-emphasis-style property -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)] #[allow(missing_docs)] #[repr(C, u8)] diff --git a/components/style/values/generics/effects.rs b/components/style/values/generics/effects.rs index 724f484f283..dd9da8759be 100644 --- a/components/style/values/generics/effects.rs +++ b/components/style/values/generics/effects.rs @@ -34,8 +34,6 @@ pub struct GenericBoxShadow { pub use self::GenericBoxShadow as BoxShadow; /// A generic value for a single `filter`. -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[animation(no_bound(U))] #[derive( diff --git a/components/style/values/generics/grid.rs b/components/style/values/generics/grid.rs index b9e173ea50f..29f634d10fe 100644 --- a/components/style/values/generics/grid.rs +++ b/components/style/values/generics/grid.rs @@ -185,8 +185,6 @@ impl Parse for GridLine { /// avoid re-implementing it for the computed type. /// /// -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, @@ -230,8 +228,6 @@ impl TrackBreadth { /// generic only to avoid code bloat. It only takes `` /// /// -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Clone, Debug, @@ -494,8 +490,6 @@ impl ToCss for TrackRepeat { } /// Track list values. Can be or -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, @@ -729,8 +723,6 @@ impl ToCss for LineNameList { } /// Variants for ` | ` -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, diff --git a/components/style/values/generics/svg.rs b/components/style/values/generics/svg.rs index 4a1fc42551d..82183c30564 100644 --- a/components/style/values/generics/svg.rs +++ b/components/style/values/generics/svg.rs @@ -9,7 +9,6 @@ use cssparser::Parser; use style_traits::ParseError; /// The fallback of an SVG paint server value. -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, @@ -43,8 +42,6 @@ pub use self::GenericSVGPaintFallback as SVGPaintFallback; /// An SVG paint value /// /// -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[animation(no_bound(Url))] #[derive( Animate, @@ -84,8 +81,6 @@ impl Default for SVGPaint { /// /// Whereas the spec only allows PaintServer to have a fallback, Gecko lets the /// context properties have a fallback as well. -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[animation(no_bound(U))] #[derive( Animate, diff --git a/components/style/values/generics/transform.rs b/components/style/values/generics/transform.rs index 8dbbdfcd168..4a8dc7f63fa 100644 --- a/components/style/values/generics/transform.rs +++ b/components/style/values/generics/transform.rs @@ -151,7 +151,6 @@ fn is_same(x: &N, y: &N) -> bool { )] #[repr(C, u8)] /// A single operation in the list of a `transform` value -/// cbindgen:derive-tagged-enum-copy-constructor=true pub enum GenericTransformOperation where Angle: Zero, diff --git a/components/style/values/generics/url.rs b/components/style/values/generics/url.rs index 1f271033036..46ed453e82d 100644 --- a/components/style/values/generics/url.rs +++ b/components/style/values/generics/url.rs @@ -5,8 +5,6 @@ //! Generic types for url properties. /// An image url or none, used for example in list-style-image -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, diff --git a/components/style/values/specified/font.rs b/components/style/values/specified/font.rs index 9e680ec7758..45af8df23bf 100644 --- a/components/style/values/specified/font.rs +++ b/components/style/values/specified/font.rs @@ -1091,8 +1091,6 @@ bitflags! { )] #[repr(C, u8)] /// Set of variant alternates -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true pub enum VariantAlternates { /// Enables display of stylistic alternates #[css(function)] diff --git a/components/style/values/specified/list.rs b/components/style/values/specified/list.rs index 3946d78652e..084889a3a22 100644 --- a/components/style/values/specified/list.rs +++ b/components/style/values/specified/list.rs @@ -126,8 +126,6 @@ pub struct QuoteList( /// Specified and computed `quotes` property: `auto`, `none`, or a list /// of characters. -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Clone, Debug, diff --git a/components/style/values/specified/motion.rs b/components/style/values/specified/motion.rs index 97609ea20b0..8d6f7809fdb 100644 --- a/components/style/values/specified/motion.rs +++ b/components/style/values/specified/motion.rs @@ -15,7 +15,6 @@ use style_traits::{ParseError, StyleParseErrorKind}; /// The offset-path value. /// /// https://drafts.fxtf.org/motion-1/#offset-path-property -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, diff --git a/components/style/values/specified/position.rs b/components/style/values/specified/position.rs index ce3bab1047b..d3476bb9f65 100644 --- a/components/style/values/specified/position.rs +++ b/components/style/values/specified/position.rs @@ -707,8 +707,6 @@ fn is_name_code_point(c: char) -> bool { /// The syntax of this property also provides a visualization of the structure /// of the grid, making the overall layout of the grid container easier to /// understand. -/// -/// cbindgen:derive-tagged-enum-copy-constructor=true #[repr(C, u8)] #[derive( Clone, diff --git a/components/style/values/specified/text.rs b/components/style/values/specified/text.rs index ebc8e8f86ee..1505192f86f 100644 --- a/components/style/values/specified/text.rs +++ b/components/style/values/specified/text.rs @@ -132,7 +132,6 @@ impl ToComputedValue for LineHeight { } /// A generic value for the `text-overflow` property. -/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[repr(C, u8)] pub enum TextOverflowSide {