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
This commit is contained in:
Emilio Cobos Álvarez 2019-08-26 23:18:46 +00:00
parent b238698691
commit 54ce45f3ee
11 changed files with 0 additions and 28 deletions

View file

@ -198,8 +198,6 @@ impl TextDecorationsInEffect {
} }
/// Computed value for the text-emphasis-style property /// Computed value for the text-emphasis-style property
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
#[allow(missing_docs)] #[allow(missing_docs)]
#[repr(C, u8)] #[repr(C, u8)]

View file

@ -34,8 +34,6 @@ pub struct GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
pub use self::GenericBoxShadow as BoxShadow; pub use self::GenericBoxShadow as BoxShadow;
/// A generic value for a single `filter`. /// A generic value for a single `filter`.
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[animation(no_bound(U))] #[animation(no_bound(U))]
#[derive( #[derive(

View file

@ -185,8 +185,6 @@ impl Parse for GridLine<specified::Integer> {
/// avoid re-implementing it for the computed type. /// avoid re-implementing it for the computed type.
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-track-breadth> /// <https://drafts.csswg.org/css-grid/#typedef-track-breadth>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Animate, Animate,
Clone, Clone,
@ -230,8 +228,6 @@ impl<L> TrackBreadth<L> {
/// generic only to avoid code bloat. It only takes `<length-percentage>` /// generic only to avoid code bloat. It only takes `<length-percentage>`
/// ///
/// <https://drafts.csswg.org/css-grid/#typedef-track-size> /// <https://drafts.csswg.org/css-grid/#typedef-track-size>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Clone, Clone,
Debug, Debug,
@ -494,8 +490,6 @@ impl<L: ToCss, I: ToCss> ToCss for TrackRepeat<L, I> {
} }
/// Track list values. Can be <track-size> or <track-repeat> /// Track list values. Can be <track-size> or <track-repeat>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Animate, Animate,
Clone, Clone,
@ -729,8 +723,6 @@ impl ToCss for LineNameList {
} }
/// Variants for `<grid-template-rows> | <grid-template-columns>` /// Variants for `<grid-template-rows> | <grid-template-columns>`
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Animate, Animate,
Clone, Clone,

View file

@ -9,7 +9,6 @@ use cssparser::Parser;
use style_traits::ParseError; use style_traits::ParseError;
/// The fallback of an SVG paint server value. /// The fallback of an SVG paint server value.
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Animate, Animate,
Clone, Clone,
@ -43,8 +42,6 @@ pub use self::GenericSVGPaintFallback as SVGPaintFallback;
/// An SVG paint value /// An SVG paint value
/// ///
/// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint> /// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[animation(no_bound(Url))] #[animation(no_bound(Url))]
#[derive( #[derive(
Animate, Animate,
@ -84,8 +81,6 @@ impl<C, U> Default for SVGPaint<C, U> {
/// ///
/// Whereas the spec only allows PaintServer to have a fallback, Gecko lets the /// Whereas the spec only allows PaintServer to have a fallback, Gecko lets the
/// context properties have a fallback as well. /// context properties have a fallback as well.
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[animation(no_bound(U))] #[animation(no_bound(U))]
#[derive( #[derive(
Animate, Animate,

View file

@ -151,7 +151,6 @@ fn is_same<N: PartialEq>(x: &N, y: &N) -> bool {
)] )]
#[repr(C, u8)] #[repr(C, u8)]
/// A single operation in the list of a `transform` value /// A single operation in the list of a `transform` value
/// cbindgen:derive-tagged-enum-copy-constructor=true
pub enum GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage> pub enum GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where where
Angle: Zero, Angle: Zero,

View file

@ -5,8 +5,6 @@
//! Generic types for url properties. //! Generic types for url properties.
/// An image url or none, used for example in list-style-image /// An image url or none, used for example in list-style-image
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Animate, Animate,
Clone, Clone,

View file

@ -1091,8 +1091,6 @@ bitflags! {
)] )]
#[repr(C, u8)] #[repr(C, u8)]
/// Set of variant alternates /// Set of variant alternates
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
pub enum VariantAlternates { pub enum VariantAlternates {
/// Enables display of stylistic alternates /// Enables display of stylistic alternates
#[css(function)] #[css(function)]

View file

@ -126,8 +126,6 @@ pub struct QuoteList(
/// Specified and computed `quotes` property: `auto`, `none`, or a list /// Specified and computed `quotes` property: `auto`, `none`, or a list
/// of characters. /// of characters.
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Clone, Clone,
Debug, Debug,

View file

@ -15,7 +15,6 @@ use style_traits::{ParseError, StyleParseErrorKind};
/// The offset-path value. /// The offset-path value.
/// ///
/// https://drafts.fxtf.org/motion-1/#offset-path-property /// https://drafts.fxtf.org/motion-1/#offset-path-property
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive( #[derive(
Animate, Animate,
Clone, Clone,

View file

@ -707,8 +707,6 @@ fn is_name_code_point(c: char) -> bool {
/// The syntax of this property also provides a visualization of the structure /// 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 /// of the grid, making the overall layout of the grid container easier to
/// understand. /// understand.
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[repr(C, u8)] #[repr(C, u8)]
#[derive( #[derive(
Clone, Clone,

View file

@ -132,7 +132,6 @@ impl ToComputedValue for LineHeight {
} }
/// A generic value for the `text-overflow` property. /// A generic value for the `text-overflow` property.
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
#[repr(C, u8)] #[repr(C, u8)]
pub enum TextOverflowSide { pub enum TextOverflowSide {