From aab57567e8b3388c7bd1bd5ae7b6e2c021002d73 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 4 Oct 2019 21:59:10 +0000 Subject: [PATCH] Bug 1576703 - Update cbindgen. r=boris 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 UltraBlame original commit: 6c3f50c6f6662291139bc292fb9dd77aa64331ee --- build/moz.configure/bindgen.configure | 2 +- layout/style/FontFace.cpp | 9 +- layout/style/FontFaceSet.cpp | 9 +- layout/style/GeckoBindings.cpp | 21 + layout/style/nsStyleStruct.cpp | 36 + .../components/style/values/computed/text.rs | 19 - .../style/values/generics/effects.rs | 19 - .../components/style/values/generics/grid.rs | 76 --- servo/components/style/values/generics/svg.rs | 54 -- .../style/values/generics/transform.rs | 16 - servo/components/style/values/generics/url.rs | 19 - .../components/style/values/specified/font.rs | 19 - .../components/style/values/specified/list.rs | 19 - .../style/values/specified/motion.rs | 16 - .../style/values/specified/position.rs | 19 - .../components/style/values/specified/text.rs | 16 - servo/ports/geckolib/cbindgen.toml | 626 +----------------- taskcluster/ci/fetch/toolchains.yml | 4 +- taskcluster/ci/toolchain/cbindgen.yml | 2 +- 19 files changed, 83 insertions(+), 918 deletions(-) diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure index f573c05e569d7..cc9612b5a6881 100644 --- a/build/moz.configure/bindgen.configure +++ b/build/moz.configure/bindgen.configure @@ -180,7 +180,7 @@ Version . 9 . -0 +1 ' ) # diff --git a/layout/style/FontFace.cpp b/layout/style/FontFace.cpp index 0a6dbad9c63ec..5d5d58468e1fd 100644 --- a/layout/style/FontFace.cpp +++ b/layout/style/FontFace.cpp @@ -3786,8 +3786,15 @@ GetFontStyle ) const { -StyleComputedFontStyleDescriptor +auto descriptor += +StyleComputedFontStyleDescriptor +: +: +Normal +( +) ; if ( diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index b41d8c493c3f0..b0892eaaf45b6 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -1535,8 +1535,15 @@ ErrorResult aRv ) { -StyleComputedFontStyleDescriptor +auto style += +StyleComputedFontStyleDescriptor +: +: +Normal +( +) ; float stretch diff --git a/layout/style/GeckoBindings.cpp b/layout/style/GeckoBindings.cpp index 58cd5c8f6c0d9..3add7fb5676f1 100644 --- a/layout/style/GeckoBindings.cpp +++ b/layout/style/GeckoBindings.cpp @@ -7130,6 +7130,17 @@ MOZ_ASSERT aImage ) ; +auto +zero += +StyleNumberOrPercentage +: +: +Number +( +0 +) +; aImage - > @@ -7143,6 +7154,16 @@ nsStyleImage CropRect > ( +nsStyleImage +: +: +CropRect +{ +zero +zero +zero +zero +} ) ) ; diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index eca0276087bf5..5b0668bb06075 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3681,6 +3681,15 @@ Auto ( ) ) +mImageRegion +( +StyleClipRectOrAuto +: +: +Auto +( +) +) mMozListReversed ( StyleMozListReversed @@ -17709,6 +17718,33 @@ mLineClamp ( 0 ) +mRotate +( +StyleRotate +: +: +None +( +) +) +mTranslate +( +StyleTranslate +: +: +None +( +) +) +mScale +( +StyleScale +: +: +None +( +) +) mBackfaceVisibility ( NS_STYLE_BACKFACE_VISIBILITY_VISIBLE diff --git a/servo/components/style/values/computed/text.rs b/servo/components/style/values/computed/text.rs index 916a91053476f..56e6eb9d76463 100644 --- a/servo/components/style/values/computed/text.rs +++ b/servo/components/style/values/computed/text.rs @@ -1464,25 +1464,6 @@ emphasis - style property -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive diff --git a/servo/components/style/values/generics/effects.rs b/servo/components/style/values/generics/effects.rs index aa01d3a817988..a30fa3e2979f8 100644 --- a/servo/components/style/values/generics/effects.rs +++ b/servo/components/style/values/generics/effects.rs @@ -193,25 +193,6 @@ a single filter . -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ cfg_attr diff --git a/servo/components/style/values/generics/grid.rs b/servo/components/style/values/generics/grid.rs index 8e774ed9012b8..6ab1ed8cf3a6a 100644 --- a/servo/components/style/values/generics/grid.rs +++ b/servo/components/style/values/generics/grid.rs @@ -1461,25 +1461,6 @@ track - breadth > -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive @@ -1749,25 +1730,6 @@ track - size > -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive @@ -3649,25 +3611,6 @@ track - repeat > -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive @@ -5216,25 +5159,6 @@ template - columns > -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive diff --git a/servo/components/style/values/generics/svg.rs b/servo/components/style/values/generics/svg.rs index 1450208abd3a7..99010b3580ae1 100644 --- a/servo/components/style/values/generics/svg.rs +++ b/servo/components/style/values/generics/svg.rs @@ -102,22 +102,6 @@ paint server value . -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive @@ -244,25 +228,6 @@ html # SpecifyingPaint > -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ animation @@ -425,25 +390,6 @@ fallback as well . -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ animation diff --git a/servo/components/style/values/generics/transform.rs b/servo/components/style/values/generics/transform.rs index af8507525a801..95fd208be6288 100644 --- a/servo/components/style/values/generics/transform.rs +++ b/servo/components/style/values/generics/transform.rs @@ -929,22 +929,6 @@ of a transform value -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true pub enum GenericTransformOperation diff --git a/servo/components/style/values/generics/url.rs b/servo/components/style/values/generics/url.rs index bf4f8973d3165..3401a4c7a40ed 100644 --- a/servo/components/style/values/generics/url.rs +++ b/servo/components/style/values/generics/url.rs @@ -82,25 +82,6 @@ list style - image -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive diff --git a/servo/components/style/values/specified/font.rs b/servo/components/style/values/specified/font.rs index dd1028c30b3ba..8e5839be97a8a 100644 --- a/servo/components/style/values/specified/font.rs +++ b/servo/components/style/values/specified/font.rs @@ -7543,25 +7543,6 @@ Set of variant alternates -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true pub enum VariantAlternates diff --git a/servo/components/style/values/specified/list.rs b/servo/components/style/values/specified/list.rs index 9c8d401e0f1a3..6950d619e9224 100644 --- a/servo/components/style/values/specified/list.rs +++ b/servo/components/style/values/specified/list.rs @@ -772,25 +772,6 @@ list of characters . -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive diff --git a/servo/components/style/values/specified/motion.rs b/servo/components/style/values/specified/motion.rs index e238e07bd5437..2677d1df27716 100644 --- a/servo/components/style/values/specified/motion.rs +++ b/servo/components/style/values/specified/motion.rs @@ -186,22 +186,6 @@ offset path - property -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive diff --git a/servo/components/style/values/specified/position.rs b/servo/components/style/values/specified/position.rs index 76dfa5f7e513d..25a8dc3986083 100644 --- a/servo/components/style/values/specified/position.rs +++ b/servo/components/style/values/specified/position.rs @@ -4593,25 +4593,6 @@ to / understand . -/ -/ -/ -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ repr diff --git a/servo/components/style/values/specified/text.rs b/servo/components/style/values/specified/text.rs index e4ea7cee2b38a..5fd7c93d06756 100644 --- a/servo/components/style/values/specified/text.rs +++ b/servo/components/style/values/specified/text.rs @@ -1134,22 +1134,6 @@ text overflow property . -/ -/ -/ -cbindgen -: -derive -- -tagged -- -enum -- -copy -- -constructor -= -true # [ derive diff --git a/servo/ports/geckolib/cbindgen.toml b/servo/ports/geckolib/cbindgen.toml index f45e2869e1064..a6064db1e164e 100644 --- a/servo/ports/geckolib/cbindgen.toml +++ b/servo/ports/geckolib/cbindgen.toml @@ -357,6 +357,12 @@ true derive_tagged_enum_destructor = true +derive_tagged_enum_copy_constructor += +true +private_default_tagged_enum_constructor += +true cast_assert_name = " @@ -1784,56 +1790,6 @@ const " " " -" -Quotes -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleQuotes -( -) -{ -} -public -: -" -" -" # TODO ( @@ -2871,106 +2827,6 @@ const " " " -GenericTransformOperation -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericTransformOperation -( -) -{ -} -public -: -" -" -" -" -GenericUrlOrNone -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericUrlOrNone -( -) -{ -} -public -: -" -" -" -" Angle " = @@ -3002,106 +2858,6 @@ const " " " -OffsetPath -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleOffsetPath -( -) -{ -} -public -: -" -" -" -" -TextOverflowSide -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleTextOverflowSide -( -) -{ -} -public -: -" -" -" -" TextOverflow " = @@ -3440,56 +3196,6 @@ const " " " -GridTemplateAreas -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGridTemplateAreas -( -) -{ -} -public -: -" -" -" -" GenericGridLine " = @@ -3547,46 +3253,6 @@ GenericTrackBreadth " " " -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericTrackBreadth -( -) -{ -} -public -: inline bool HasPercent @@ -3604,46 +3270,6 @@ GenericTrackSize " " " -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericTrackSize -( -) -{ -} -public -: / / Implemented @@ -3679,152 +3305,12 @@ const " " " -GenericSVGPaintKind -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericSVGPaintKind -( -) -{ -} -public -: -" -" -" -" -GenericSVGPaintFallback -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericSVGPaintFallback -( -) -{ -} -public -: -" -" -" -" GenericGridTemplateComponent " = " " " -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleGenericGridTemplateComponent -( -) -{ -} -public -: inline Maybe < @@ -3890,106 +3376,6 @@ const " " " -TextEmphasisStyle -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleTextEmphasisStyle -( -) -{ -} -public -: -" -" -" -" -VariantAlternates -" -= -" -" -" -private -: -/ -/ -Private -default -constructor -without -initialization -so -that -the -helper -/ -/ -constructor -functions -still -work -as -expected -. -They -take -care -of -/ -/ -initializing -the -fields -properly -. -StyleVariantAlternates -( -) -{ -} -public -: -" -" -" -" GenericClipRect " = diff --git a/taskcluster/ci/fetch/toolchains.yml b/taskcluster/ci/fetch/toolchains.yml index cf357414e00c4..52ae9abb8ff38 100644 --- a/taskcluster/ci/fetch/toolchains.yml +++ b/taskcluster/ci/fetch/toolchains.yml @@ -2108,7 +2108,7 @@ cbindgen . 9 . -0 +1 : description : @@ -2135,7 +2135,7 @@ eqrion cbindgen revision : -e19526e00b3fe6921b881682147a1fe5d6b64124 +8e4db4c17fbdc0cfa9b98cfe9d47ca6263858def cctools - port diff --git a/taskcluster/ci/toolchain/cbindgen.yml b/taskcluster/ci/toolchain/cbindgen.yml index 59a2bf7121bde..b72e4caecef6e 100644 --- a/taskcluster/ci/toolchain/cbindgen.yml +++ b/taskcluster/ci/toolchain/cbindgen.yml @@ -142,7 +142,7 @@ cbindgen . 9 . -0 +1 linux64 - cbindgen