Skip to content

Commit

Permalink
style: Update cbindgen.
Browse files Browse the repository at this point in the history
This cleans up the pattern of "Use a private dtor so that the helper functions
do the right thing" by enabling it everywhere using:

  mozilla/cbindgen#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
  • Loading branch information
emilio committed Sep 12, 2019
1 parent b238698 commit 54ce45f
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 28 deletions.
2 changes: 0 additions & 2 deletions components/style/values/computed/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 0 additions & 2 deletions components/style/values/generics/effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ pub struct GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
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(
Expand Down
8 changes: 0 additions & 8 deletions components/style/values/generics/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ impl Parse for GridLine<specified::Integer> {
/// avoid re-implementing it for the computed type.
///
/// <https://drafts.csswg.org/css-grid/#typedef-track-breadth>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(
Animate,
Clone,
Expand Down Expand Up @@ -230,8 +228,6 @@ impl<L> TrackBreadth<L> {
/// generic only to avoid code bloat. It only takes `<length-percentage>`
///
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(
Clone,
Debug,
Expand Down Expand Up @@ -494,8 +490,6 @@ impl<L: ToCss, I: ToCss> ToCss for TrackRepeat<L, I> {
}

/// Track list values. Can be <track-size> or <track-repeat>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(
Animate,
Clone,
Expand Down Expand Up @@ -729,8 +723,6 @@ impl ToCss for LineNameList {
}

/// Variants for `<grid-template-rows> | <grid-template-columns>`
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(
Animate,
Clone,
Expand Down
5 changes: 0 additions & 5 deletions components/style/values/generics/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -43,8 +42,6 @@ pub use self::GenericSVGPaintFallback as SVGPaintFallback;
/// An SVG paint value
///
/// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint>
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[animation(no_bound(Url))]
#[derive(
Animate,
Expand Down Expand Up @@ -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
/// context properties have a fallback as well.
///
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[animation(no_bound(U))]
#[derive(
Animate,
Expand Down
1 change: 0 additions & 1 deletion components/style/values/generics/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ fn is_same<N: PartialEq>(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<Angle, Number, Length, Integer, LengthPercentage>
where
Angle: Zero,
Expand Down
2 changes: 0 additions & 2 deletions components/style/values/generics/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions components/style/values/specified/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 0 additions & 2 deletions components/style/values/specified/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion components/style/values/specified/motion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions components/style/values/specified/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion components/style/values/specified/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 54ce45f

Please sign in to comment.