From c7792974792cbc700821ab1ebdba9fa20d97f5e1 Mon Sep 17 00:00:00 2001 From: Kowasaki Date: Fri, 5 May 2017 11:14:15 -0700 Subject: Emit `PhantomData>` members for all generic parameters This makes generated generic structs lifetime invariant, since we cannot know the C++ type's true variance. Fixes #506 --- src/codegen/mod.rs | 11 +- .../expectations/tests/anonymous-template-types.rs | 2 + tests/expectations/tests/class_nested.rs | 3 + tests/expectations/tests/class_with_dtor.rs | 1 + tests/expectations/tests/const_tparam.rs | 1 + .../tests/default-template-parameter.rs | 2 + .../tests/forward-declaration-autoptr.rs | 1 + .../tests/forward-inherit-struct-with-fields.rs | 2 + tests/expectations/tests/inherit_named.rs | 1 + .../issue-584-stylo-template-analysis-panic.rs | 1 + .../issue-638-stylo-cannot-find-T-in-this-scope.rs | 2 + .../issue-645-cannot-find-type-T-in-this-scope.rs | 1 + .../tests/issue-662-cannot-find-T-in-this-scope.rs | 3 + tests/expectations/tests/issue-662-part-2.rs | 2 + tests/expectations/tests/namespace.rs | 2 + tests/expectations/tests/nsStyleAutoArray.rs | 2 + tests/expectations/tests/replace_template_alias.rs | 1 + tests/expectations/tests/replaces_double.rs | 1 + tests/expectations/tests/template-param-usage-0.rs | 1 + .../expectations/tests/template-param-usage-10.rs | 4 + .../expectations/tests/template-param-usage-12.rs | 2 + .../expectations/tests/template-param-usage-13.rs | 1 + .../expectations/tests/template-param-usage-15.rs | 1 + tests/expectations/tests/template-param-usage-2.rs | 2 + tests/expectations/tests/template-param-usage-3.rs | 3 + tests/expectations/tests/template-param-usage-4.rs | 1 + tests/expectations/tests/template-param-usage-5.rs | 1 + tests/expectations/tests/template-param-usage-7.rs | 2 + tests/expectations/tests/template-param-usage-8.rs | 2 + tests/expectations/tests/template-param-usage-9.rs | 2 + tests/expectations/tests/template.rs | 12 + tests/expectations/tests/template_alias.rs | 1 + .../expectations/tests/template_alias_namespace.rs | 1 + .../tests/template_typedef_transitive_param.rs | 1 + .../type_alias_partial_template_especialization.rs | 1 + tests/expectations/tests/using.rs | 1 + tests/expectations/tests/what_is_going_on.rs | 1 + tests/expectations/tests/whitelist_basic.rs | 2 + tests/stylo_sanity.rs | 1095 ++++++++++---------- 39 files changed, 628 insertions(+), 548 deletions(-) diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 697c140f..7f0a822a 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1465,11 +1465,20 @@ impl CodeGenerator for CompInfo { let mut generics = aster::AstBuilder::new().generics(); if let Some(ref params) = used_template_params { - for ty in params.iter() { + for (idx, ty) in params.iter().enumerate() { let param = ctx.resolve_type(*ty); let name = param.name().unwrap(); let ident = ctx.rust_ident(name); + generics = generics.ty_param_id(ident); + + let prefix = ctx.trait_prefix(); + let phantom_ty = quote_ty!( + ctx.ext_cx(), + ::$prefix::marker::PhantomData<::$prefix::cell::UnsafeCell<$ident>>); + let phantom_field = StructFieldBuilder::named(format!("_phantom_{}", idx)) + .build_ty(phantom_ty); + fields.push(phantom_field); } } diff --git a/tests/expectations/tests/anonymous-template-types.rs b/tests/expectations/tests/anonymous-template-types.rs index c225b69d..50604a3f 100644 --- a/tests/expectations/tests/anonymous-template-types.rs +++ b/tests/expectations/tests/anonymous-template-types.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct Foo { pub t_member: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Foo { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -21,6 +22,7 @@ pub struct Bar { #[derive(Debug, Copy, Clone)] pub struct Quux { pub v_member: V, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Quux { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs index b92976f6..8446cbcd 100644 --- a/tests/expectations/tests/class_nested.rs +++ b/tests/expectations/tests/class_nested.rs @@ -53,6 +53,7 @@ impl Clone for A_C { #[derive(Debug, Copy, Clone)] pub struct A_D { pub foo: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for A_D { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -115,11 +116,13 @@ impl Clone for D { #[derive(Debug, Copy, Clone)] pub struct Templated { pub member: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Templated_Templated_inner { pub member_ptr: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Templated_Templated_inner { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs index 495889f2..3b15b891 100644 --- a/tests/expectations/tests/class_with_dtor.rs +++ b/tests/expectations/tests/class_with_dtor.rs @@ -8,6 +8,7 @@ #[derive(Debug)] pub struct HandleWithDtor { pub ptr: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for HandleWithDtor { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/const_tparam.rs b/tests/expectations/tests/const_tparam.rs index f47ca082..7600e18e 100644 --- a/tests/expectations/tests/const_tparam.rs +++ b/tests/expectations/tests/const_tparam.rs @@ -9,6 +9,7 @@ pub struct C { pub foo: *const T, pub bar: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for C { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/default-template-parameter.rs b/tests/expectations/tests/default-template-parameter.rs index af4616ff..c098dac7 100644 --- a/tests/expectations/tests/default-template-parameter.rs +++ b/tests/expectations/tests/default-template-parameter.rs @@ -9,6 +9,8 @@ pub struct Foo { pub t: T, pub u: U, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Foo { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/forward-declaration-autoptr.rs b/tests/expectations/tests/forward-declaration-autoptr.rs index d3729bed..e129e0fb 100644 --- a/tests/expectations/tests/forward-declaration-autoptr.rs +++ b/tests/expectations/tests/forward-declaration-autoptr.rs @@ -13,6 +13,7 @@ pub struct Foo { #[derive(Debug, Copy, Clone)] pub struct RefPtr { pub m_inner: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for RefPtr { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/forward-inherit-struct-with-fields.rs b/tests/expectations/tests/forward-inherit-struct-with-fields.rs index ce61a545..1b31f62b 100644 --- a/tests/expectations/tests/forward-inherit-struct-with-fields.rs +++ b/tests/expectations/tests/forward-inherit-struct-with-fields.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct Rooted { pub _base: js_RootedBase, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Rooted { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -17,6 +18,7 @@ impl Default for Rooted { pub struct js_RootedBase { pub foo: *mut T, pub next: *mut Rooted, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for js_RootedBase { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/inherit_named.rs b/tests/expectations/tests/inherit_named.rs index 703df9ea..a641de70 100644 --- a/tests/expectations/tests/inherit_named.rs +++ b/tests/expectations/tests/inherit_named.rs @@ -13,6 +13,7 @@ pub struct Wohoo { #[derive(Debug, Copy, Clone)] pub struct Weeee { pub _base: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Weeee { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs index 91b8e49a..ddcaf3fc 100644 --- a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs +++ b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs @@ -43,6 +43,7 @@ impl Clone for A { #[derive(Debug, Copy, Clone)] pub struct e { pub d: RefPtr, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for e { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs b/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs index 4ff0b5bc..3afaf62d 100644 --- a/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs +++ b/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct RefPtr { pub use_of_t: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for RefPtr { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -16,6 +17,7 @@ impl Default for RefPtr { #[derive(Debug, Copy, Clone)] pub struct UsesRefPtrWithAliasedTypeParam { pub member: RefPtr>, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } pub type UsesRefPtrWithAliasedTypeParam_V = U; impl Default for UsesRefPtrWithAliasedTypeParam { diff --git a/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs b/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs index 531bce67..c9695b69 100644 --- a/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs +++ b/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs @@ -9,6 +9,7 @@ #[derive(Debug, Copy, Clone)] pub struct HasRefPtr { pub refptr_member: RefPtr>, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } pub type HasRefPtr_TypedefOfT = T; impl Default for HasRefPtr { diff --git a/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs b/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs index 0c16b235..4a81f24e 100644 --- a/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs +++ b/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct RefPtr { pub a: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for RefPtr { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -16,6 +17,7 @@ impl Default for RefPtr { #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHolder { pub a: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for nsMainThreadPtrHolder { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -24,6 +26,7 @@ impl Default for nsMainThreadPtrHolder { #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHandle { pub mPtr: RefPtr>, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for nsMainThreadPtrHandle { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/issue-662-part-2.rs b/tests/expectations/tests/issue-662-part-2.rs index fa80c5fe..eb9a34d1 100644 --- a/tests/expectations/tests/issue-662-part-2.rs +++ b/tests/expectations/tests/issue-662-part-2.rs @@ -9,6 +9,7 @@ #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHolder { pub a: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for nsMainThreadPtrHolder { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -17,6 +18,7 @@ impl Default for nsMainThreadPtrHolder { #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHandle { pub mPtr: RefPtr>, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for nsMainThreadPtrHandle { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs index 8e64fa22..86d5e892 100644 --- a/tests/expectations/tests/namespace.rs +++ b/tests/expectations/tests/namespace.rs @@ -69,6 +69,7 @@ pub mod root { pub m_c: T, pub m_c_ptr: *mut T, pub m_c_arr: [T; 10usize], + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for C { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -81,6 +82,7 @@ pub mod root { #[derive(Debug)] pub struct D { pub m_c: root::C, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for D { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/nsStyleAutoArray.rs b/tests/expectations/tests/nsStyleAutoArray.rs index bc5f5184..04f01c0c 100644 --- a/tests/expectations/tests/nsStyleAutoArray.rs +++ b/tests/expectations/tests/nsStyleAutoArray.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct nsTArray { pub mBuff: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for nsTArray { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -17,6 +18,7 @@ impl Default for nsTArray { pub struct nsStyleAutoArray { pub mFirstElement: T, pub mOtherElements: nsTArray, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/replace_template_alias.rs b/tests/expectations/tests/replace_template_alias.rs index dbd0d283..65a5332b 100644 --- a/tests/expectations/tests/replace_template_alias.rs +++ b/tests/expectations/tests/replace_template_alias.rs @@ -12,6 +12,7 @@ pub type JS_detail_MaybeWrapped = T; #[derive(Debug, Copy, Clone)] pub struct JS_Rooted { pub ptr: JS_detail_MaybeWrapped, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for JS_Rooted { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/replaces_double.rs b/tests/expectations/tests/replaces_double.rs index 99b812db..f7093d3d 100644 --- a/tests/expectations/tests/replaces_double.rs +++ b/tests/expectations/tests/replaces_double.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct Rooted { pub ptr: Rooted_MaybeWrapped, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } /** *
diff --git a/tests/expectations/tests/template-param-usage-0.rs b/tests/expectations/tests/template-param-usage-0.rs index 494001f7..a36d729a 100644 --- a/tests/expectations/tests/template-param-usage-0.rs +++ b/tests/expectations/tests/template-param-usage-0.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter { pub t: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for UsesTemplateParameter { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-10.rs b/tests/expectations/tests/template-param-usage-10.rs index 95d200b5..d41740cd 100644 --- a/tests/expectations/tests/template-param-usage-10.rs +++ b/tests/expectations/tests/template-param-usage-10.rs @@ -8,6 +8,8 @@ #[derive(Debug, Copy, Clone)] pub struct DoublyIndirectUsage { pub doubly_indirect: DoublyIndirectUsage_IndirectUsage, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } pub type DoublyIndirectUsage_Aliased = T; pub type DoublyIndirectUsage_Typedefed = U; @@ -16,6 +18,8 @@ pub type DoublyIndirectUsage_Typedefed = U; pub struct DoublyIndirectUsage_IndirectUsage { pub member: DoublyIndirectUsage_Aliased, pub another: DoublyIndirectUsage_Typedefed, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for DoublyIndirectUsage_IndirectUsage { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-12.rs b/tests/expectations/tests/template-param-usage-12.rs index 0c31111e..fcf10615 100644 --- a/tests/expectations/tests/template-param-usage-12.rs +++ b/tests/expectations/tests/template-param-usage-12.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct BaseUsesT { pub t: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for BaseUsesT { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -17,6 +18,7 @@ impl Default for BaseUsesT { pub struct CrtpUsesU { pub _base: BaseUsesT>, pub usage: U, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for CrtpUsesU { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-13.rs b/tests/expectations/tests/template-param-usage-13.rs index c77da097..10e45ed1 100644 --- a/tests/expectations/tests/template-param-usage-13.rs +++ b/tests/expectations/tests/template-param-usage-13.rs @@ -14,6 +14,7 @@ pub struct BaseIgnoresT { pub struct CrtpUsesU { pub _base: BaseIgnoresT, pub usage: U, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for CrtpUsesU { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-15.rs b/tests/expectations/tests/template-param-usage-15.rs index a653e089..77667b45 100644 --- a/tests/expectations/tests/template-param-usage-15.rs +++ b/tests/expectations/tests/template-param-usage-15.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct BaseUsesT { pub usage: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for BaseUsesT { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-2.rs b/tests/expectations/tests/template-param-usage-2.rs index 6dc21b68..4f5987a1 100644 --- a/tests/expectations/tests/template-param-usage-2.rs +++ b/tests/expectations/tests/template-param-usage-2.rs @@ -8,11 +8,13 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter { pub t: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter_AlsoUsesTemplateParameter { pub also: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for UsesTemplateParameter_AlsoUsesTemplateParameter { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-3.rs b/tests/expectations/tests/template-param-usage-3.rs index a7ff22f9..07571dcc 100644 --- a/tests/expectations/tests/template-param-usage-3.rs +++ b/tests/expectations/tests/template-param-usage-3.rs @@ -8,12 +8,15 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter { pub t: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter_AlsoUsesTemplateParameterAndMore { pub also: T, pub more: U, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for UsesTemplateParameter_AlsoUsesTemplateParameterAndMore { diff --git a/tests/expectations/tests/template-param-usage-4.rs b/tests/expectations/tests/template-param-usage-4.rs index 31f8872d..7b8fe9f1 100644 --- a/tests/expectations/tests/template-param-usage-4.rs +++ b/tests/expectations/tests/template-param-usage-4.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter { pub t: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-5.rs b/tests/expectations/tests/template-param-usage-5.rs index 5a9caf32..3efdfac3 100644 --- a/tests/expectations/tests/template-param-usage-5.rs +++ b/tests/expectations/tests/template-param-usage-5.rs @@ -8,6 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct IndirectlyUsesTemplateParameter { pub aliased: IndirectlyUsesTemplateParameter_Aliased, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } pub type IndirectlyUsesTemplateParameter_Aliased = T; impl Default for IndirectlyUsesTemplateParameter { diff --git a/tests/expectations/tests/template-param-usage-7.rs b/tests/expectations/tests/template-param-usage-7.rs index 2544ffd0..3d1378ad 100644 --- a/tests/expectations/tests/template-param-usage-7.rs +++ b/tests/expectations/tests/template-param-usage-7.rs @@ -9,6 +9,8 @@ pub struct DoesNotUseU { pub t: T, pub v: V, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for DoesNotUseU { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-8.rs b/tests/expectations/tests/template-param-usage-8.rs index b181cc09..322c7257 100644 --- a/tests/expectations/tests/template-param-usage-8.rs +++ b/tests/expectations/tests/template-param-usage-8.rs @@ -9,6 +9,8 @@ pub struct IndirectUsage { pub member1: IndirectUsage_Typedefed, pub member2: IndirectUsage_Aliased, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } pub type IndirectUsage_Typedefed = T; pub type IndirectUsage_Aliased = U; diff --git a/tests/expectations/tests/template-param-usage-9.rs b/tests/expectations/tests/template-param-usage-9.rs index d0a3f29f..5f2319c4 100644 --- a/tests/expectations/tests/template-param-usage-9.rs +++ b/tests/expectations/tests/template-param-usage-9.rs @@ -16,6 +16,8 @@ pub type DoesNotUse_Typedefed = U; pub struct DoesNotUse_IndirectUsage { pub member: DoesNotUse_Aliased, pub another: DoesNotUse_Typedefed, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for DoesNotUse_IndirectUsage { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs index 911b0e6a..682c6db9 100644 --- a/tests/expectations/tests/template.rs +++ b/tests/expectations/tests/template.rs @@ -10,6 +10,7 @@ pub struct Foo { pub m_member: T, pub m_member_ptr: *mut T, pub m_member_arr: [T; 1usize], + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Foo { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -29,6 +30,7 @@ pub type D_MyFoo = Foo<::std::os::raw::c_int>; pub struct D_U { pub m_nested_foo: D_MyFoo, pub m_baz: Z, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for D_U { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -42,6 +44,7 @@ pub struct Rooted { pub prev: *mut T, pub next: *mut Rooted<*mut ::std::os::raw::c_void>, pub ptr: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Rooted { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -73,6 +76,7 @@ impl Default for RootedContainer { #[derive(Debug)] pub struct WithDtor { pub member: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for WithDtor { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -133,6 +137,7 @@ impl Clone for POD { #[derive(Debug, Copy, Clone)] pub struct NestedReplaced { pub buff: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for NestedReplaced { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -141,6 +146,7 @@ impl Default for NestedReplaced { #[derive(Debug, Copy, Clone)] pub struct NestedBase { pub buff: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for NestedBase { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -149,6 +155,7 @@ impl Default for NestedBase { #[derive(Debug, Copy, Clone)] pub struct Incomplete { pub d: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Incomplete { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -159,6 +166,7 @@ pub struct NestedContainer { pub c: T, pub nested: NestedReplaced, pub inc: Incomplete, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for NestedContainer { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -193,6 +201,7 @@ pub struct Templated { #[derive(Debug)] pub struct ReplacedWithoutDestructor { pub buff: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for ReplacedWithoutDestructor { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -201,6 +210,7 @@ impl Default for ReplacedWithoutDestructor { #[derive(Debug)] pub struct ShouldNotBeCopiable { pub m_member: ReplacedWithoutDestructor, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for ShouldNotBeCopiable { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -209,6 +219,7 @@ impl Default for ShouldNotBeCopiable { #[derive(Debug)] pub struct ShouldNotBeCopiableAsWell { pub m_member: ReplacedWithoutDestructorFwd, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for ShouldNotBeCopiableAsWell { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -223,6 +234,7 @@ impl Default for ShouldNotBeCopiableAsWell { #[derive(Debug)] pub struct ReplacedWithoutDestructorFwd { pub buff: *mut T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for ReplacedWithoutDestructorFwd { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template_alias.rs b/tests/expectations/tests/template_alias.rs index 44f7830f..f98d165d 100644 --- a/tests/expectations/tests/template_alias.rs +++ b/tests/expectations/tests/template_alias.rs @@ -9,6 +9,7 @@ pub type JS_detail_Wrapped = T; #[derive(Debug, Copy, Clone)] pub struct JS_Rooted { pub ptr: JS_detail_Wrapped, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for JS_Rooted { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template_alias_namespace.rs b/tests/expectations/tests/template_alias_namespace.rs index 90740a2d..491bb68c 100644 --- a/tests/expectations/tests/template_alias_namespace.rs +++ b/tests/expectations/tests/template_alias_namespace.rs @@ -20,6 +20,7 @@ pub mod root { #[derive(Debug, Copy, Clone)] pub struct Rooted { pub ptr: root::JS::detail::Wrapped, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Rooted { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template_typedef_transitive_param.rs b/tests/expectations/tests/template_typedef_transitive_param.rs index 265ab5ce..5f6b4c38 100644 --- a/tests/expectations/tests/template_typedef_transitive_param.rs +++ b/tests/expectations/tests/template_typedef_transitive_param.rs @@ -13,6 +13,7 @@ pub struct Wrapper { #[derive(Debug, Copy, Clone)] pub struct Wrapper_Wrapped { pub t: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Wrapper_Wrapped { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/type_alias_partial_template_especialization.rs b/tests/expectations/tests/type_alias_partial_template_especialization.rs index 2e0f2f4d..09c32486 100644 --- a/tests/expectations/tests/type_alias_partial_template_especialization.rs +++ b/tests/expectations/tests/type_alias_partial_template_especialization.rs @@ -9,6 +9,7 @@ pub type MaybeWrapped = A; #[derive(Debug, Copy, Clone)] pub struct Rooted { pub ptr: MaybeWrapped, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Rooted { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/using.rs b/tests/expectations/tests/using.rs index 1638287a..44376b93 100644 --- a/tests/expectations/tests/using.rs +++ b/tests/expectations/tests/using.rs @@ -9,6 +9,7 @@ pub struct Point { pub x: T, pub y: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for Point { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/what_is_going_on.rs b/tests/expectations/tests/what_is_going_on.rs index e5194c02..fa56f04b 100644 --- a/tests/expectations/tests/what_is_going_on.rs +++ b/tests/expectations/tests/what_is_going_on.rs @@ -25,6 +25,7 @@ pub type Float = f32; pub struct PointTyped { pub x: F, pub y: F, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for PointTyped { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/whitelist_basic.rs b/tests/expectations/tests/whitelist_basic.rs index 8af4aba3..a83f0273 100644 --- a/tests/expectations/tests/whitelist_basic.rs +++ b/tests/expectations/tests/whitelist_basic.rs @@ -9,11 +9,13 @@ pub struct WhitelistMe { pub foo: ::std::os::raw::c_int, pub bar: WhitelistMe_Inner, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct WhitelistMe_Inner { pub bar: T, + _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } impl Default for WhitelistMe_Inner { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs index d925cb33..c75d65a4 100755 --- a/tests/stylo_sanity.rs +++ b/tests/stylo_sanity.rs @@ -1,547 +1,548 @@ -extern crate bindgen; - -/// A sanity test that we can generate bindings for Stylo. -/// -/// We don't assert on expected output because its just too big. The output will -/// change too often, and it won't be clear what is going on at a glance, unlike -/// the other tests with smaller input headers. -/// -/// This test is relatively slow, so we also only run it in release mode. -/// -/// Finally, uncomment the `panic!` at the bottom of the test to get logs timing -/// how long bindings generation takes for Stylo. Stylo bindings generation -/// takes too long to be a proper `#[bench]`. -#[test] -#[cfg(not(any(debug_assertions, - feature = "testing_only_extra_assertions", - feature = "testing_only_llvm_stable")))] -fn sanity_check_can_generate_stylo_bindings() { - use std::time::Instant; - - let then = Instant::now(); - - bindgen::builder() - .header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/stylo.hpp")) - .whitelisted_function("Servo_.*") - .whitelisted_function("Gecko_.*") - .hide_type("nsACString_internal") - .hide_type("nsAString_internal") - .hide_type("mozilla::css::URLValue") - .hide_type("RawGeckoAnimationPropertySegment") - .hide_type("RawGeckoComputedTiming") - .hide_type("RawGeckoDocument") - .hide_type("RawGeckoElement") - .hide_type("RawGeckoKeyframeList") - .hide_type("RawGeckoComputedKeyframeValuesList") - .hide_type("RawGeckoFontFaceRuleList") - .hide_type("RawGeckoNode") - .hide_type("RawGeckoAnimationValueList") - .hide_type("RawServoAnimationValue") - .hide_type("RawServoAnimationValueMap") - .hide_type("RawServoDeclarationBlock") - .hide_type("RawGeckoPresContext") - .hide_type("RawGeckoPresContextOwned") - .hide_type("RawGeckoStyleAnimationList") - .hide_type("RawGeckoURLExtraData") - .hide_type("RefPtr") - .hide_type("CSSPseudoClassType") - .hide_type("TraversalRootBehavior") - .hide_type("ComputedTimingFunction_BeforeFlag") - .hide_type("FontFamilyList") - .hide_type("FontFamilyType") - .hide_type("Keyframe") - .hide_type("ServoBundledURI") - .hide_type("ServoElementSnapshot") - .hide_type("SheetParsingMode") - .hide_type("StyleBasicShape") - .hide_type("StyleBasicShapeType") - .hide_type("StyleShapeSource") - .hide_type("nsCSSFontFaceRule") - .hide_type("nsCSSKeyword") - .hide_type("nsCSSPropertyID") - .hide_type("nsCSSShadowArray") - .hide_type("nsCSSUnit") - .hide_type("nsCSSValue") - .hide_type("nsCSSValueSharedList") - .hide_type("nsChangeHint") - .hide_type("nsCursorImage") - .hide_type("nsFont") - .hide_type("nsIAtom") - .hide_type("nsMediaFeature") - .hide_type("nsRestyleHint") - .hide_type("nsStyleBackground") - .hide_type("nsStyleBorder") - .hide_type("nsStyleColor") - .hide_type("nsStyleColumn") - .hide_type("nsStyleContent") - .hide_type("nsStyleContentData") - .hide_type("nsStyleContentType") - .hide_type("nsStyleContext") - .hide_type("nsStyleCoord") - .hide_type("nsStyleCoord_Calc") - .hide_type("nsStyleCoord_CalcValue") - .hide_type("nsStyleDisplay") - .hide_type("nsStyleEffects") - .hide_type("nsStyleFilter") - .hide_type("nsStyleFont") - .hide_type("nsStyleGradient") - .hide_type("nsStyleGradientStop") - .hide_type("nsStyleImage") - .hide_type("nsStyleImageLayers") - .hide_type("nsStyleImageLayers_Layer") - .hide_type("nsStyleImageLayers_LayerType") - .hide_type("nsStyleImageRequest") - .hide_type("nsStyleList") - .hide_type("nsStyleMargin") - .hide_type("nsStyleOutline") - .hide_type("nsStylePadding") - .hide_type("nsStylePosition") - .hide_type("nsStyleQuoteValues") - .hide_type("nsStyleSVG") - .hide_type("nsStyleSVGPaint") - .hide_type("nsStyleSVGReset") - .hide_type("nsStyleTable") - .hide_type("nsStyleTableBorder") - .hide_type("nsStyleText") - .hide_type("nsStyleTextReset") - .hide_type("nsStyleUIReset") - .hide_type("nsStyleUnion") - .hide_type("nsStyleUnit") - .hide_type("nsStyleUserInterface") - .hide_type("nsStyleVariables") - .hide_type("nsStyleVisibility") - .hide_type("nsStyleXUL") - .hide_type("nsTimingFunction") - .hide_type("nscolor") - .hide_type("nscoord") - .hide_type("nsresult") - .hide_type("Loader") - .hide_type("ServoStyleSheet") - .hide_type("EffectCompositor_CascadeLevel") - .hide_type("UpdateAnimationsTasks") - .hide_type("nsTArrayBorrowed_uintptr_t") - .hide_type("ServoCssRulesStrong") - .hide_type("ServoCssRulesBorrowed") - .hide_type("ServoCssRulesBorrowedOrNull") - .hide_type("ServoCssRules") - .hide_type("RawServoStyleSheetStrong") - .hide_type("RawServoStyleSheetBorrowed") - .hide_type("RawServoStyleSheetBorrowedOrNull") - .hide_type("RawServoStyleSheet") - .hide_type("ServoComputedValuesStrong") - .hide_type("ServoComputedValuesBorrowed") - .hide_type("ServoComputedValuesBorrowedOrNull") - .hide_type("ServoComputedValues") - .hide_type("RawServoDeclarationBlockStrong") - .hide_type("RawServoDeclarationBlockBorrowed") - .hide_type("RawServoDeclarationBlockBorrowedOrNull") - .hide_type("RawServoStyleRuleStrong") - .hide_type("RawServoStyleRuleBorrowed") - .hide_type("RawServoStyleRuleBorrowedOrNull") - .hide_type("RawServoStyleRule") - .hide_type("RawServoImportRuleStrong") - .hide_type("RawServoImportRuleBorrowed") - .hide_type("RawServoImportRuleBorrowedOrNull") - .hide_type("RawServoImportRule") - .hide_type("RawServoAnimationValueStrong") - .hide_type("RawServoAnimationValueBorrowed") - .hide_type("RawServoAnimationValueBorrowedOrNull") - .hide_type("RawServoAnimationValueMapStrong") - .hide_type("RawServoAnimationValueMapBorrowed") - .hide_type("RawServoAnimationValueMapBorrowedOrNull") - .hide_type("RawServoMediaListStrong") - .hide_type("RawServoMediaListBorrowed") - .hide_type("RawServoMediaListBorrowedOrNull") - .hide_type("RawServoMediaList") - .hide_type("RawServoMediaRuleStrong") - .hide_type("RawServoMediaRuleBorrowed") - .hide_type("RawServoMediaRuleBorrowedOrNull") - .hide_type("RawServoMediaRule") - .hide_type("RawServoNamespaceRuleStrong") - .hide_type("RawServoNamespaceRuleBorrowed") - .hide_type("RawServoNamespaceRuleBorrowedOrNull") - .hide_type("RawServoNamespaceRule") - .hide_type("RawServoStyleSetOwned") - .hide_type("RawServoStyleSetOwnedOrNull") - .hide_type("RawServoStyleSetBorrowed") - .hide_type("RawServoStyleSetBorrowedOrNull") - .hide_type("RawServoStyleSetBorrowedMut") - .hide_type("RawServoStyleSetBorrowedMutOrNull") - .hide_type("RawServoStyleSet") - .hide_type("StyleChildrenIteratorOwned") - .hide_type("StyleChildrenIteratorOwnedOrNull") - .hide_type("StyleChildrenIteratorBorrowed") - .hide_type("StyleChildrenIteratorBorrowedOrNull") - .hide_type("StyleChildrenIteratorBorrowedMut") - .hide_type("StyleChildrenIteratorBorrowedMutOrNull") - .hide_type("StyleChildrenIterator") - .hide_type("ServoElementSnapshotOwned") - .hide_type("ServoElementSnapshotOwnedOrNull") - .hide_type("ServoElementSnapshotBorrowed") - .hide_type("ServoElementSnapshotBorrowedOrNull") - .hide_type("ServoElementSnapshotBorrowedMut") - .hide_type("ServoElementSnapshotBorrowedMutOrNull") - .hide_type("RawGeckoNodeBorrowed") - .hide_type("RawGeckoNodeBorrowedOrNull") - .hide_type("RawGeckoElementBorrowed") - .hide_type("RawGeckoElementBorrowedOrNull") - .hide_type("RawGeckoDocumentBorrowed") - .hide_type("RawGeckoDocumentBorrowedOrNull") - .hide_type("RawServoDeclarationBlockStrongBorrowed") - .hide_type("RawServoDeclarationBlockStrongBorrowedOrNull") - .hide_type("RawGeckoPresContextBorrowed") - .hide_type("RawGeckoPresContextBorrowedOrNull") - .hide_type("RawGeckoStyleAnimationListBorrowed") - .hide_type("RawGeckoStyleAnimationListBorrowedOrNull") - .hide_type("nsCSSValueBorrowed") - .hide_type("nsCSSValueBorrowedOrNull") - .hide_type("nsCSSValueBorrowedMut") - .hide_type("nsCSSValueBorrowedMutOrNull") - .hide_type("nsTimingFunctionBorrowed") - .hide_type("nsTimingFunctionBorrowedOrNull") - .hide_type("nsTimingFunctionBorrowedMut") - .hide_type("nsTimingFunctionBorrowedMutOrNull") - .hide_type("RawGeckoAnimationPropertySegmentBorrowed") - .hide_type("RawGeckoAnimationPropertySegmentBorrowedOrNull") - .hide_type("RawGeckoAnimationPropertySegmentBorrowedMut") - .hide_type("RawGeckoAnimationPropertySegmentBorrowedMutOrNull") - .hide_type("RawGeckoAnimationValueListBorrowed") - .hide_type("RawGeckoAnimationValueListBorrowedOrNull") - .hide_type("RawGeckoAnimationValueListBorrowedMut") - .hide_type("RawGeckoAnimationValueListBorrowedMutOrNull") - .hide_type("RawGeckoComputedTimingBorrowed") - .hide_type("RawGeckoComputedTimingBorrowedOrNull") - .hide_type("RawGeckoComputedTimingBorrowedMut") - .hide_type("RawGeckoComputedTimingBorrowedMutOrNull") - .hide_type("RawGeckoKeyframeListBorrowed") - .hide_type("RawGeckoKeyframeListBorrowedOrNull") - .hide_type("RawGeckoKeyframeListBorrowedMut") - .hide_type("RawGeckoKeyframeListBorrowedMutOrNull") - .hide_type("RawGeckoComputedKeyframeValuesListBorrowed") - .hide_type("RawGeckoComputedKeyframeValuesListBorrowedOrNull") - .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMut") - .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMutOrNull") - .hide_type("RawGeckoFontFaceRuleListBorrowed") - .hide_type("RawGeckoFontFaceRuleListBorrowedOrNull") - .hide_type("RawGeckoFontFaceRuleListBorrowedMut") - .hide_type("RawGeckoFontFaceRuleListBorrowedMutOrNull") - .raw_line(r#"pub use nsstring::{nsACString, nsAString, nsString};"#) - .raw_line(r#"type nsACString_internal = nsACString;"#) - .raw_line(r#"type nsAString_internal = nsAString;"#) - .raw_line(r#"use gecko_bindings::structs::mozilla::css::URLValue;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationPropertySegment;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedTiming;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoDocument;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoElement;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoKeyframeList;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedKeyframeValuesList;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoFontFaceRuleList;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoNode;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationValueList;"#) - .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValue;"#) - .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValueMap;"#) - .raw_line(r#"use gecko_bindings::structs::RawServoDeclarationBlock;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContext;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContextOwned;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoStyleAnimationList;"#) - .raw_line(r#"use gecko_bindings::structs::RawGeckoURLExtraData;"#) - .raw_line(r#"use gecko_bindings::structs::RefPtr;"#) - .raw_line(r#"use gecko_bindings::structs::CSSPseudoClassType;"#) - .raw_line(r#"use gecko_bindings::structs::TraversalRootBehavior;"#) - .raw_line(r#"use gecko_bindings::structs::ComputedTimingFunction_BeforeFlag;"#) - .raw_line(r#"use gecko_bindings::structs::FontFamilyList;"#) - .raw_line(r#"use gecko_bindings::structs::FontFamilyType;"#) - .raw_line(r#"use gecko_bindings::structs::Keyframe;"#) - .raw_line(r#"use gecko_bindings::structs::ServoBundledURI;"#) - .raw_line(r#"use gecko_bindings::structs::ServoElementSnapshot;"#) - .raw_line(r#"use gecko_bindings::structs::SheetParsingMode;"#) - .raw_line(r#"use gecko_bindings::structs::StyleBasicShape;"#) - .raw_line(r#"use gecko_bindings::structs::StyleBasicShapeType;"#) - .raw_line(r#"use gecko_bindings::structs::StyleShapeSource;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSFontFaceRule;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSKeyword;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSPropertyID;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSShadowArray;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSUnit;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSValue;"#) - .raw_line(r#"use gecko_bindings::structs::nsCSSValueSharedList;"#) - .raw_line(r#"use gecko_bindings::structs::nsChangeHint;"#) - .raw_line(r#"use gecko_bindings::structs::nsCursorImage;"#) - .raw_line(r#"use gecko_bindings::structs::nsFont;"#) - .raw_line(r#"use gecko_bindings::structs::nsIAtom;"#) - .raw_line(r#"use gecko_bindings::structs::nsMediaFeature;"#) - .raw_line(r#"use gecko_bindings::structs::nsRestyleHint;"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleBackground;"#) - .raw_line(r#"unsafe impl Send for nsStyleBackground {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleBackground {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleBorder;"#) - .raw_line(r#"unsafe impl Send for nsStyleBorder {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleBorder {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleColor;"#) - .raw_line(r#"unsafe impl Send for nsStyleColor {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleColor {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleColumn;"#) - .raw_line(r#"unsafe impl Send for nsStyleColumn {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleColumn {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleContent;"#) - .raw_line(r#"unsafe impl Send for nsStyleContent {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleContent {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleContentData;"#) - .raw_line(r#"unsafe impl Send for nsStyleContentData {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleContentData {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleContentType;"#) - .raw_line(r#"unsafe impl Send for nsStyleContentType {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleContentType {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleContext;"#) - .raw_line(r#"unsafe impl Send for nsStyleContext {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleContext {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleCoord;"#) - .raw_line(r#"unsafe impl Send for nsStyleCoord {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleCoord {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_Calc;"#) - .raw_line(r#"unsafe impl Send for nsStyleCoord_Calc {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleCoord_Calc {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_CalcValue;"#) - .raw_line(r#"unsafe impl Send for nsStyleCoord_CalcValue {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleCoord_CalcValue {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleDisplay;"#) - .raw_line(r#"unsafe impl Send for nsStyleDisplay {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleDisplay {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleEffects;"#) - .raw_line(r#"unsafe impl Send for nsStyleEffects {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleEffects {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleFilter;"#) - .raw_line(r#"unsafe impl Send for nsStyleFilter {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleFilter {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleFont;"#) - .raw_line(r#"unsafe impl Send for nsStyleFont {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleFont {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleGradient;"#) - .raw_line(r#"unsafe impl Send for nsStyleGradient {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleGradient {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleGradientStop;"#) - .raw_line(r#"unsafe impl Send for nsStyleGradientStop {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleGradientStop {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleImage;"#) - .raw_line(r#"unsafe impl Send for nsStyleImage {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleImage {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers;"#) - .raw_line(r#"unsafe impl Send for nsStyleImageLayers {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleImageLayers {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_Layer;"#) - .raw_line(r#"unsafe impl Send for nsStyleImageLayers_Layer {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_Layer {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_LayerType;"#) - .raw_line(r#"unsafe impl Send for nsStyleImageLayers_LayerType {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_LayerType {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleImageRequest;"#) - .raw_line(r#"unsafe impl Send for nsStyleImageRequest {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleImageRequest {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleList;"#) - .raw_line(r#"unsafe impl Send for nsStyleList {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleList {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleMargin;"#) - .raw_line(r#"unsafe impl Send for nsStyleMargin {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleMargin {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleOutline;"#) - .raw_line(r#"unsafe impl Send for nsStyleOutline {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleOutline {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStylePadding;"#) - .raw_line(r#"unsafe impl Send for nsStylePadding {}"#) - .raw_line(r#"unsafe impl Sync for nsStylePadding {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStylePosition;"#) - .raw_line(r#"unsafe impl Send for nsStylePosition {}"#) - .raw_line(r#"unsafe impl Sync for nsStylePosition {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleQuoteValues;"#) - .raw_line(r#"unsafe impl Send for nsStyleQuoteValues {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleQuoteValues {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleSVG;"#) - .raw_line(r#"unsafe impl Send for nsStyleSVG {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleSVG {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleSVGPaint;"#) - .raw_line(r#"unsafe impl Send for nsStyleSVGPaint {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleSVGPaint {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleSVGReset;"#) - .raw_line(r#"unsafe impl Send for nsStyleSVGReset {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleSVGReset {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleTable;"#) - .raw_line(r#"unsafe impl Send for nsStyleTable {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleTable {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleTableBorder;"#) - .raw_line(r#"unsafe impl Send for nsStyleTableBorder {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleTableBorder {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleText;"#) - .raw_line(r#"unsafe impl Send for nsStyleText {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleText {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleTextReset;"#) - .raw_line(r#"unsafe impl Send for nsStyleTextReset {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleTextReset {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleUIReset;"#) - .raw_line(r#"unsafe impl Send for nsStyleUIReset {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleUIReset {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleUnion;"#) - .raw_line(r#"unsafe impl Send for nsStyleUnion {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleUnion {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleUnit;"#) - .raw_line(r#"unsafe impl Send for nsStyleUnit {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleUnit {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleUserInterface;"#) - .raw_line(r#"unsafe impl Send for nsStyleUserInterface {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleUserInterface {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleVariables;"#) - .raw_line(r#"unsafe impl Send for nsStyleVariables {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleVariables {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleVisibility;"#) - .raw_line(r#"unsafe impl Send for nsStyleVisibility {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleVisibility {}"#) - .raw_line(r#"use gecko_bindings::structs::nsStyleXUL;"#) - .raw_line(r#"unsafe impl Send for nsStyleXUL {}"#) - .raw_line(r#"unsafe impl Sync for nsStyleXUL {}"#) - .raw_line(r#"use gecko_bindings::structs::nsTimingFunction;"#) - .raw_line(r#"use gecko_bindings::structs::nscolor;"#) - .raw_line(r#"use gecko_bindings::structs::nscoord;"#) - .raw_line(r#"use gecko_bindings::structs::nsresult;"#) - .raw_line(r#"use gecko_bindings::structs::Loader;"#) - .raw_line(r#"use gecko_bindings::structs::ServoStyleSheet;"#) - .raw_line(r#"use gecko_bindings::structs::EffectCompositor_CascadeLevel;"#) - .raw_line(r#"use gecko_bindings::structs::UpdateAnimationsTasks;"#) - .raw_line(r#"pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray;"#) - .raw_line(r#"pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;"#) - .raw_line(r#"pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;"#) - .raw_line(r#"enum ServoCssRulesVoid { }"#) - .raw_line(r#"pub struct ServoCssRules(ServoCssRulesVoid);"#) - .raw_line(r#"pub type RawServoStyleSheetStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;"#) - .raw_line(r#"pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;"#) - .raw_line(r#"enum RawServoStyleSheetVoid { }"#) - .raw_line(r#"pub struct RawServoStyleSheet(RawServoStyleSheetVoid);"#) - .raw_line(r#"pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;"#) - .raw_line(r#"pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;"#) - .raw_line(r#"enum ServoComputedValuesVoid { }"#) - .raw_line(r#"pub struct ServoComputedValues(ServoComputedValuesVoid);"#) - .raw_line(r#"pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;"#) - .raw_line(r#"pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;"#) - .raw_line(r#"pub type RawServoStyleRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoStyleRuleBorrowed<'a> = &'a RawServoStyleRule;"#) - .raw_line(r#"pub type RawServoStyleRuleBorrowedOrNull<'a> = Option<&'a RawServoStyleRule>;"#) - .raw_line(r#"enum RawServoStyleRuleVoid { }"#) - .raw_line(r#"pub struct RawServoStyleRule(RawServoStyleRuleVoid);"#) - .raw_line(r#"pub type RawServoImportRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoImportRuleBorrowed<'a> = &'a RawServoImportRule;"#) - .raw_line(r#"pub type RawServoImportRuleBorrowedOrNull<'a> = Option<&'a RawServoImportRule>;"#) - .raw_line(r#"enum RawServoImportRuleVoid { }"#) - .raw_line(r#"pub struct RawServoImportRule(RawServoImportRuleVoid);"#) - .raw_line(r#"pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue;"#) - .raw_line(r#"pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>;"#) - .raw_line(r#"pub type RawServoAnimationValueMapStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap;"#) - .raw_line(r#"pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>;"#) - .raw_line(r#"pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList;"#) - .raw_line(r#"pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>;"#) - .raw_line(r#"enum RawServoMediaListVoid { }"#) - .raw_line(r#"pub struct RawServoMediaList(RawServoMediaListVoid);"#) - .raw_line(r#"pub type RawServoMediaRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule;"#) - .raw_line(r#"pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>;"#) - .raw_line(r#"enum RawServoMediaRuleVoid { }"#) - .raw_line(r#"pub struct RawServoMediaRule(RawServoMediaRuleVoid);"#) - .raw_line(r#"pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) - .raw_line(r#"pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;"#) - .raw_line(r#"pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;"#) - .raw_line(r#"enum RawServoNamespaceRuleVoid { }"#) - .raw_line(r#"pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);"#) - .raw_line(r#"pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned;"#) - .raw_line(r#"pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull;"#) - .raw_line(r#"pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;"#) - .raw_line(r#"pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>;"#) - .raw_line(r#"pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;"#) - .raw_line(r#"pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>;"#) - .raw_line(r#"enum RawServoStyleSetVoid { }"#) - .raw_line(r#"pub struct RawServoStyleSet(RawServoStyleSetVoid);"#) - .raw_line(r#"pub type StyleChildrenIteratorOwned = ::gecko_bindings::sugar::ownership::Owned;"#) - .raw_line(r#"pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull;"#) - .raw_line(r#"pub type StyleChildrenIteratorBorrowed<'a> = &'a StyleChildrenIterator;"#) - .raw_line(r#"pub type StyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a StyleChildrenIterator>;"#) - .raw_line(r#"pub type StyleChildrenIteratorBorrowedMut<'a> = &'a mut StyleChildrenIterator;"#) - .raw_line(r#"pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildrenIterator>;"#) - .raw_line(r#"enum StyleChildrenIteratorVoid { }"#) - .raw_line(r#"pub struct StyleChildrenIterator(StyleChildrenIteratorVoid);"#) - .raw_line(r#"pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned;"#) - .raw_line(r#"pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull;"#) - .raw_line(r#"pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot;"#) - .raw_line(r#"pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>;"#) - .raw_line(r#"pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot;"#) - .raw_line(r#"pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>;"#) - .raw_line(r#"pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;"#) - .raw_line(r#"pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;"#) - .raw_line(r#"pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;"#) - .raw_line(r#"pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>;"#) - .raw_line(r#"pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;"#) - .raw_line(r#"pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;"#) - .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong;"#) - .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;"#) - .raw_line(r#"pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext;"#) - .raw_line(r#"pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>;"#) - .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList;"#) - .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>;"#) - .raw_line(r#"pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue;"#) - .raw_line(r#"pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>;"#) - .raw_line(r#"pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue;"#) - .raw_line(r#"pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>;"#) - .raw_line(r#"pub type nsTimingFunctionBorrowed<'a> = &'a nsTimingFunction;"#) - .raw_line(r#"pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>;"#) - .raw_line(r#"pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction;"#) - .raw_line(r#"pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>;"#) - .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment;"#) - .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>;"#) - .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment;"#) - .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>;"#) - .raw_line(r#"pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList;"#) - .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>;"#) - .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList;"#) - .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>;"#) - .raw_line(r#"pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming;"#) - .raw_line(r#"pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>;"#) - .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming;"#) - .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedTiming>;"#) - .raw_line(r#"pub type RawGeckoKeyframeListBorrowed<'a> = &'a RawGeckoKeyframeList;"#) - .raw_line(r#"pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeList>;"#) - .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList;"#) - .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>;"#) - .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList;"#) - .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>;"#) - .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList;"#) - .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>;"#) - .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList;"#) - .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>;"#) - .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList;"#) - .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>;"#) - .clang_arg("-x") - .clang_arg("c++") - .clang_arg("-std=c++14") - .clang_arg("-DTRACING=1") - .clang_arg("-DIMPL_LIBXUL") - .clang_arg("-DMOZ_STYLO_BINDINGS=1") - .clang_arg("-DMOZILLA_INTERNAL_API") - .clang_arg("-DRUST_BINDGEN") - .clang_arg("-DMOZ_STYLO") - .clang_arg("-DOS_POSIX=1") - .clang_arg("-DOS_LINUX=1") - .generate() - .expect("Should generate stylo bindings"); - - let now = Instant::now(); - - println!(""); - println!(""); - println!("Generated Stylo bindings in: {:?}", now.duration_since(then)); - println!(""); - println!(""); - - // panic!("Uncomment this line to get timing logs"); -} +extern crate bindgen; + +/// A sanity test that we can generate bindings for Stylo. +/// +/// We don't assert on expected output because its just too big. The output will +/// change too often, and it won't be clear what is going on at a glance, unlike +/// the other tests with smaller input headers. +/// +/// This test is relatively slow, so we also only run it in release mode. +/// +/// Finally, uncomment the `panic!` at the bottom of the test to get logs timing +/// how long bindings generation takes for Stylo. Stylo bindings generation +/// takes too long to be a proper `#[bench]`. +#[test] +#[cfg(not(any(debug_assertions, + feature = "testing_only_extra_assertions", + feature = "testing_only_llvm_stable")))] +fn sanity_check_can_generate_stylo_bindings() { + use std::time::Instant; + + let then = Instant::now(); + + bindgen::builder() + .header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/stylo.hpp")) + .whitelisted_function("Servo_.*") + .whitelisted_function("Gecko_.*") + .hide_type("nsACString_internal") + .hide_type("nsAString_internal") + .hide_type("mozilla::css::URLValue") + .hide_type("RawGeckoAnimationPropertySegment") + .hide_type("RawGeckoComputedTiming") + .hide_type("RawGeckoDocument") + .hide_type("RawGeckoElement") + .hide_type("RawGeckoKeyframeList") + .hide_type("RawGeckoComputedKeyframeValuesList") + .hide_type("RawGeckoFontFaceRuleList") + .hide_type("RawGeckoNode") + .hide_type("RawGeckoAnimationValueList") + .hide_type("RawServoAnimationValue") + .hide_type("RawServoAnimationValueMap") + .hide_type("RawServoDeclarationBlock") + .hide_type("RawGeckoPresContext") + .hide_type("RawGeckoPresContextOwned") + .hide_type("RawGeckoStyleAnimationList") + .hide_type("RawGeckoURLExtraData") + .hide_type("RefPtr") + .hide_type("CSSPseudoClassType") + .hide_type("TraversalRootBehavior") + .hide_type("ComputedTimingFunction_BeforeFlag") + .hide_type("FontFamilyList") + .hide_type("FontFamilyType") + .hide_type("Keyframe") + .hide_type("ServoBundledURI") + .hide_type("ServoElementSnapshot") + .hide_type("SheetParsingMode") + .hide_type("StyleBasicShape") + .hide_type("StyleBasicShapeType") + .hide_type("StyleShapeSource") + .hide_type("nsCSSFontFaceRule") + .hide_type("nsCSSKeyword") + .hide_type("nsCSSPropertyID") + .hide_type("nsCSSShadowArray") + .hide_type("nsCSSUnit") + .hide_type("nsCSSValue") + .hide_type("nsCSSValueSharedList") + .hide_type("nsChangeHint") + .hide_type("nsCursorImage") + .hide_type("nsFont") + .hide_type("nsIAtom") + .hide_type("nsMediaFeature") + .hide_type("nsRestyleHint") + .hide_type("nsStyleBackground") + .hide_type("nsStyleBorder") + .hide_type("nsStyleColor") + .hide_type("nsStyleColumn") + .hide_type("nsStyleContent") + .hide_type("nsStyleContentData") + .hide_type("nsStyleContentType") + .hide_type("nsStyleContext") + .hide_type("nsStyleCoord") + .hide_type("nsStyleCoord_Calc") + .hide_type("nsStyleCoord_CalcValue") + .hide_type("nsStyleDisplay") + .hide_type("nsStyleEffects") + .hide_type("nsStyleFilter") + .hide_type("nsStyleFont") + .hide_type("nsStyleGradient") + .hide_type("nsStyleGradientStop") + .hide_type("nsStyleImage") + .hide_type("nsStyleImageLayers") + .hide_type("nsStyleImageLayers_Layer") + .hide_type("nsStyleImageLayers_LayerType") + .hide_type("nsStyleImageRequest") + .hide_type("nsStyleList") + .hide_type("nsStyleMargin") + .hide_type("nsStyleOutline") + .hide_type("nsStylePadding") + .hide_type("nsStylePosition") + .hide_type("nsStyleQuoteValues") + .hide_type("nsStyleSVG") + .hide_type("nsStyleSVGPaint") + .hide_type("nsStyleSVGReset") + .hide_type("nsStyleTable") + .hide_type("nsStyleTableBorder") + .hide_type("nsStyleText") + .hide_type("nsStyleTextReset") + .hide_type("nsStyleUIReset") + .hide_type("nsStyleUnion") + .hide_type("nsStyleUnit") + .hide_type("nsStyleUserInterface") + .hide_type("nsStyleVariables") + .hide_type("nsStyleVisibility") + .hide_type("nsStyleXUL") + .hide_type("nsTimingFunction") + .hide_type("nscolor") + .hide_type("nscoord") + .hide_type("nsresult") + .hide_type("Loader") + .hide_type("ServoStyleSheet") + .hide_type("EffectCompositor_CascadeLevel") + .hide_type("UpdateAnimationsTasks") + .hide_type("nsTArrayBorrowed_uintptr_t") + .hide_type("ServoCssRulesStrong") + .hide_type("ServoCssRulesBorrowed") + .hide_type("ServoCssRulesBorrowedOrNull") + .hide_type("ServoCssRules") + .hide_type("RawServoStyleSheetStrong") + .hide_type("RawServoStyleSheetBorrowed") + .hide_type("RawServoStyleSheetBorrowedOrNull") + .hide_type("RawServoStyleSheet") + .hide_type("ServoComputedValuesStrong") + .hide_type("ServoComputedValuesBorrowed") + .hide_type("ServoComputedValuesBorrowedOrNull") + .hide_type("ServoComputedValues") + .hide_type("RawServoDeclarationBlockStrong") + .hide_type("RawServoDeclarationBlockBorrowed") + .hide_type("RawServoDeclarationBlockBorrowedOrNull") + .hide_type("RawServoStyleRuleStrong") + .hide_type("RawServoStyleRuleBorrowed") + .hide_type("RawServoStyleRuleBorrowedOrNull") + .hide_type("RawServoStyleRule") + .hide_type("RawServoImportRuleStrong") + .hide_type("RawServoImportRuleBorrowed") + .hide_type("RawServoImportRuleBorrowedOrNull") + .hide_type("RawServoImportRule") + .hide_type("RawServoAnimationValueStrong") + .hide_type("RawServoAnimationValueBorrowed") + .hide_type("RawServoAnimationValueBorrowedOrNull") + .hide_type("RawServoAnimationValueMapStrong") + .hide_type("RawServoAnimationValueMapBorrowed") + .hide_type("RawServoAnimationValueMapBorrowedOrNull") + .hide_type("RawServoMediaListStrong") + .hide_type("RawServoMediaListBorrowed") + .hide_type("RawServoMediaListBorrowedOrNull") + .hide_type("RawServoMediaList") + .hide_type("RawServoMediaRuleStrong") + .hide_type("RawServoMediaRuleBorrowed") + .hide_type("RawServoMediaRuleBorrowedOrNull") + .hide_type("RawServoMediaRule") + .hide_type("RawServoNamespaceRuleStrong") + .hide_type("RawServoNamespaceRuleBorrowed") + .hide_type("RawServoNamespaceRuleBorrowedOrNull") + .hide_type("RawServoNamespaceRule") + .hide_type("RawServoStyleSetOwned") + .hide_type("RawServoStyleSetOwnedOrNull") + .hide_type("RawServoStyleSetBorrowed") + .hide_type("RawServoStyleSetBorrowedOrNull") + .hide_type("RawServoStyleSetBorrowedMut") + .hide_type("RawServoStyleSetBorrowedMutOrNull") + .hide_type("RawServoStyleSet") + .hide_type("StyleChildrenIteratorOwned") + .hide_type("StyleChildrenIteratorOwnedOrNull") + .hide_type("StyleChildrenIteratorBorrowed") + .hide_type("StyleChildrenIteratorBorrowedOrNull") + .hide_type("StyleChildrenIteratorBorrowedMut") + .hide_type("StyleChildrenIteratorBorrowedMutOrNull") + .hide_type("StyleChildrenIterator") + .hide_type("ServoElementSnapshotOwned") + .hide_type("ServoElementSnapshotOwnedOrNull") + .hide_type("ServoElementSnapshotBorrowed") + .hide_type("ServoElementSnapshotBorrowedOrNull") + .hide_type("ServoElementSnapshotBorrowedMut") + .hide_type("ServoElementSnapshotBorrowedMutOrNull") + .hide_type("RawGeckoNodeBorrowed") + .hide_type("RawGeckoNodeBorrowedOrNull") + .hide_type("RawGeckoElementBorrowed") + .hide_type("RawGeckoElementBorrowedOrNull") + .hide_type("RawGeckoDocumentBorrowed") + .hide_type("RawGeckoDocumentBorrowedOrNull") + .hide_type("RawServoDeclarationBlockStrongBorrowed") + .hide_type("RawServoDeclarationBlockStrongBorrowedOrNull") + .hide_type("RawGeckoPresContextBorrowed") + .hide_type("RawGeckoPresContextBorrowedOrNull") + .hide_type("RawGeckoStyleAnimationListBorrowed") + .hide_type("RawGeckoStyleAnimationListBorrowedOrNull") + .hide_type("nsCSSValueBorrowed") + .hide_type("nsCSSValueBorrowedOrNull") + .hide_type("nsCSSValueBorrowedMut") + .hide_type("nsCSSValueBorrowedMutOrNull") + .hide_type("nsTimingFunctionBorrowed") + .hide_type("nsTimingFunctionBorrowedOrNull") + .hide_type("nsTimingFunctionBorrowedMut") + .hide_type("nsTimingFunctionBorrowedMutOrNull") + .hide_type("RawGeckoAnimationPropertySegmentBorrowed") + .hide_type("RawGeckoAnimationPropertySegmentBorrowedOrNull") + .hide_type("RawGeckoAnimationPropertySegmentBorrowedMut") + .hide_type("RawGeckoAnimationPropertySegmentBorrowedMutOrNull") + .hide_type("RawGeckoAnimationValueListBorrowed") + .hide_type("RawGeckoAnimationValueListBorrowedOrNull") + .hide_type("RawGeckoAnimationValueListBorrowedMut") + .hide_type("RawGeckoAnimationValueListBorrowedMutOrNull") + .hide_type("RawGeckoComputedTimingBorrowed") + .hide_type("RawGeckoComputedTimingBorrowedOrNull") + .hide_type("RawGeckoComputedTimingBorrowedMut") + .hide_type("RawGeckoComputedTimingBorrowedMutOrNull") + .hide_type("RawGeckoKeyframeListBorrowed") + .hide_type("RawGeckoKeyframeListBorrowedOrNull") + .hide_type("RawGeckoKeyframeListBorrowedMut") + .hide_type("RawGeckoKeyframeListBorrowedMutOrNull") + .hide_type("RawGeckoComputedKeyframeValuesListBorrowed") + .hide_type("RawGeckoComputedKeyframeValuesListBorrowedOrNull") + .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMut") + .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMutOrNull") + .hide_type("RawGeckoFontFaceRuleListBorrowed") + .hide_type("RawGeckoFontFaceRuleListBorrowedOrNull") + .hide_type("RawGeckoFontFaceRuleListBorrowedMut") + .hide_type("RawGeckoFontFaceRuleListBorrowedMutOrNull") + .raw_line(r#"pub use nsstring::{nsACString, nsAString, nsString};"#) + .raw_line(r#"type nsACString_internal = nsACString;"#) + .raw_line(r#"type nsAString_internal = nsAString;"#) + .raw_line(r#"use gecko_bindings::structs::mozilla::css::URLValue;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationPropertySegment;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedTiming;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoDocument;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoElement;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoKeyframeList;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedKeyframeValuesList;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoFontFaceRuleList;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoNode;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationValueList;"#) + .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValue;"#) + .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValueMap;"#) + .raw_line(r#"use gecko_bindings::structs::RawServoDeclarationBlock;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContext;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContextOwned;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoStyleAnimationList;"#) + .raw_line(r#"use gecko_bindings::structs::RawGeckoURLExtraData;"#) + .raw_line(r#"use gecko_bindings::structs::RefPtr;"#) + .raw_line(r#"use gecko_bindings::structs::CSSPseudoClassType;"#) + .raw_line(r#"use gecko_bindings::structs::TraversalRootBehavior;"#) + .raw_line(r#"use gecko_bindings::structs::ComputedTimingFunction_BeforeFlag;"#) + .raw_line(r#"use gecko_bindings::structs::FontFamilyList;"#) + .raw_line(r#"use gecko_bindings::structs::FontFamilyType;"#) + .raw_line(r#"use gecko_bindings::structs::Keyframe;"#) + .raw_line(r#"use gecko_bindings::structs::ServoBundledURI;"#) + .raw_line(r#"use gecko_bindings::structs::ServoElementSnapshot;"#) + .raw_line(r#"use gecko_bindings::structs::SheetParsingMode;"#) + .raw_line(r#"use gecko_bindings::structs::StyleBasicShape;"#) + .raw_line(r#"use gecko_bindings::structs::StyleBasicShapeType;"#) + .raw_line(r#"use gecko_bindings::structs::StyleShapeSource;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSFontFaceRule;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSKeyword;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSPropertyID;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSShadowArray;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSUnit;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSValue;"#) + .raw_line(r#"use gecko_bindings::structs::nsCSSValueSharedList;"#) + .raw_line(r#"use gecko_bindings::structs::nsChangeHint;"#) + .raw_line(r#"use gecko_bindings::structs::nsCursorImage;"#) + .raw_line(r#"use gecko_bindings::structs::nsFont;"#) + .raw_line(r#"use gecko_bindings::structs::nsIAtom;"#) + .raw_line(r#"use gecko_bindings::structs::nsMediaFeature;"#) + .raw_line(r#"use gecko_bindings::structs::nsRestyleHint;"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleBackground;"#) + .raw_line(r#"unsafe impl Send for nsStyleBackground {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleBackground {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleBorder;"#) + .raw_line(r#"unsafe impl Send for nsStyleBorder {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleBorder {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleColor;"#) + .raw_line(r#"unsafe impl Send for nsStyleColor {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleColor {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleColumn;"#) + .raw_line(r#"unsafe impl Send for nsStyleColumn {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleColumn {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleContent;"#) + .raw_line(r#"unsafe impl Send for nsStyleContent {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleContent {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleContentData;"#) + .raw_line(r#"unsafe impl Send for nsStyleContentData {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleContentData {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleContentType;"#) + .raw_line(r#"unsafe impl Send for nsStyleContentType {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleContentType {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleContext;"#) + .raw_line(r#"unsafe impl Send for nsStyleContext {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleContext {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleCoord;"#) + .raw_line(r#"unsafe impl Send for nsStyleCoord {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleCoord {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_Calc;"#) + .raw_line(r#"unsafe impl Send for nsStyleCoord_Calc {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleCoord_Calc {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_CalcValue;"#) + .raw_line(r#"unsafe impl Send for nsStyleCoord_CalcValue {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleCoord_CalcValue {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleDisplay;"#) + .raw_line(r#"unsafe impl Send for nsStyleDisplay {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleDisplay {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleEffects;"#) + .raw_line(r#"unsafe impl Send for nsStyleEffects {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleEffects {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleFilter;"#) + .raw_line(r#"unsafe impl Send for nsStyleFilter {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleFilter {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleFont;"#) + .raw_line(r#"unsafe impl Send for nsStyleFont {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleFont {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleGradient;"#) + .raw_line(r#"unsafe impl Send for nsStyleGradient {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleGradient {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleGradientStop;"#) + .raw_line(r#"unsafe impl Send for nsStyleGradientStop {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleGradientStop {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleImage;"#) + .raw_line(r#"unsafe impl Send for nsStyleImage {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleImage {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers;"#) + .raw_line(r#"unsafe impl Send for nsStyleImageLayers {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleImageLayers {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_Layer;"#) + .raw_line(r#"unsafe impl Send for nsStyleImageLayers_Layer {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_Layer {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_LayerType;"#) + .raw_line(r#"unsafe impl Send for nsStyleImageLayers_LayerType {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_LayerType {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleImageRequest;"#) + .raw_line(r#"unsafe impl Send for nsStyleImageRequest {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleImageRequest {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleList;"#) + .raw_line(r#"unsafe impl Send for nsStyleList {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleList {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleMargin;"#) + .raw_line(r#"unsafe impl Send for nsStyleMargin {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleMargin {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleOutline;"#) + .raw_line(r#"unsafe impl Send for nsStyleOutline {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleOutline {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStylePadding;"#) + .raw_line(r#"unsafe impl Send for nsStylePadding {}"#) + .raw_line(r#"unsafe impl Sync for nsStylePadding {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStylePosition;"#) + .raw_line(r#"unsafe impl Send for nsStylePosition {}"#) + .raw_line(r#"unsafe impl Sync for nsStylePosition {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleQuoteValues;"#) + .raw_line(r#"unsafe impl Send for nsStyleQuoteValues {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleQuoteValues {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleSVG;"#) + .raw_line(r#"unsafe impl Send for nsStyleSVG {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleSVG {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleSVGPaint;"#) + .raw_line(r#"unsafe impl Send for nsStyleSVGPaint {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleSVGPaint {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleSVGReset;"#) + .raw_line(r#"unsafe impl Send for nsStyleSVGReset {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleSVGReset {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleTable;"#) + .raw_line(r#"unsafe impl Send for nsStyleTable {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleTable {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleTableBorder;"#) + .raw_line(r#"unsafe impl Send for nsStyleTableBorder {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleTableBorder {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleText;"#) + .raw_line(r#"unsafe impl Send for nsStyleText {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleText {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleTextReset;"#) + .raw_line(r#"unsafe impl Send for nsStyleTextReset {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleTextReset {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleUIReset;"#) + .raw_line(r#"unsafe impl Send for nsStyleUIReset {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleUIReset {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleUnion;"#) + .raw_line(r#"unsafe impl Send for nsStyleUnion {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleUnion {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleUnit;"#) + .raw_line(r#"unsafe impl Send for nsStyleUnit {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleUnit {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleUserInterface;"#) + .raw_line(r#"unsafe impl Send for nsStyleUserInterface {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleUserInterface {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleVariables;"#) + .raw_line(r#"unsafe impl Send for nsStyleVariables {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleVariables {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleVisibility;"#) + .raw_line(r#"unsafe impl Send for nsStyleVisibility {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleVisibility {}"#) + .raw_line(r#"use gecko_bindings::structs::nsStyleXUL;"#) + .raw_line(r#"unsafe impl Send for nsStyleXUL {}"#) + .raw_line(r#"unsafe impl Sync for nsStyleXUL {}"#) + .raw_line(r#"use gecko_bindings::structs::nsTimingFunction;"#) + .raw_line(r#"use gecko_bindings::structs::nscolor;"#) + .raw_line(r#"use gecko_bindings::structs::nscoord;"#) + .raw_line(r#"use gecko_bindings::structs::nsresult;"#) + .raw_line(r#"use gecko_bindings::structs::Loader;"#) + .raw_line(r#"use gecko_bindings::structs::ServoStyleSheet;"#) + .raw_line(r#"use gecko_bindings::structs::EffectCompositor_CascadeLevel;"#) + .raw_line(r#"use gecko_bindings::structs::UpdateAnimationsTasks;"#) + .raw_line(r#"pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray;"#) + .raw_line(r#"pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;"#) + .raw_line(r#"pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;"#) + .raw_line(r#"enum ServoCssRulesVoid { }"#) + .raw_line(r#"pub struct ServoCssRules(ServoCssRulesVoid);"#) + .raw_line(r#"pub type RawServoStyleSheetStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;"#) + .raw_line(r#"pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;"#) + .raw_line(r#"enum RawServoStyleSheetVoid { }"#) + .raw_line(r#"pub struct RawServoStyleSheet(RawServoStyleSheetVoid);"#) + .raw_line(r#"pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;"#) + .raw_line(r#"pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;"#) + .raw_line(r#"enum ServoComputedValuesVoid { }"#) + .raw_line(r#"pub struct ServoComputedValues(ServoComputedValuesVoid);"#) + .raw_line(r#"pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;"#) + .raw_line(r#"pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;"#) + .raw_line(r#"pub type RawServoStyleRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoStyleRuleBorrowed<'a> = &'a RawServoStyleRule;"#) + .raw_line(r#"pub type RawServoStyleRuleBorrowedOrNull<'a> = Option<&'a RawServoStyleRule>;"#) + .raw_line(r#"enum RawServoStyleRuleVoid { }"#) + .raw_line(r#"pub struct RawServoStyleRule(RawServoStyleRuleVoid);"#) + .raw_line(r#"pub type RawServoImportRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoImportRuleBorrowed<'a> = &'a RawServoImportRule;"#) + .raw_line(r#"pub type RawServoImportRuleBorrowedOrNull<'a> = Option<&'a RawServoImportRule>;"#) + .raw_line(r#"enum RawServoImportRuleVoid { }"#) + .raw_line(r#"pub struct RawServoImportRule(RawServoImportRuleVoid);"#) + .raw_line(r#"pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue;"#) + .raw_line(r#"pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>;"#) + .raw_line(r#"pub type RawServoAnimationValueMapStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap;"#) + .raw_line(r#"pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>;"#) + .raw_line(r#"pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList;"#) + .raw_line(r#"pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>;"#) + .raw_line(r#"enum RawServoMediaListVoid { }"#) + .raw_line(r#"pub struct RawServoMediaList(RawServoMediaListVoid);"#) + .raw_line(r#"pub type RawServoMediaRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule;"#) + .raw_line(r#"pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>;"#) + .raw_line(r#"enum RawServoMediaRuleVoid { }"#) + .raw_line(r#"pub struct RawServoMediaRule(RawServoMediaRuleVoid);"#) + .raw_line(r#"pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong;"#) + .raw_line(r#"pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;"#) + .raw_line(r#"pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;"#) + .raw_line(r#"enum RawServoNamespaceRuleVoid { }"#) + .raw_line(r#"pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);"#) + .raw_line(r#"pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned;"#) + .raw_line(r#"pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull;"#) + .raw_line(r#"pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;"#) + .raw_line(r#"pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>;"#) + .raw_line(r#"pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;"#) + .raw_line(r#"pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>;"#) + .raw_line(r#"enum RawServoStyleSetVoid { }"#) + .raw_line(r#"pub struct RawServoStyleSet(RawServoStyleSetVoid);"#) + .raw_line(r#"pub type StyleChildrenIteratorOwned = ::gecko_bindings::sugar::ownership::Owned;"#) + .raw_line(r#"pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull;"#) + .raw_line(r#"pub type StyleChildrenIteratorBorrowed<'a> = &'a StyleChildrenIterator;"#) + .raw_line(r#"pub type StyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a StyleChildrenIterator>;"#) + .raw_line(r#"pub type StyleChildrenIteratorBorrowedMut<'a> = &'a mut StyleChildrenIterator;"#) + .raw_line(r#"pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildrenIterator>;"#) + .raw_line(r#"enum StyleChildrenIteratorVoid { }"#) + .raw_line(r#"pub struct StyleChildrenIterator(StyleChildrenIteratorVoid);"#) + .raw_line(r#"pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned;"#) + .raw_line(r#"pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull;"#) + .raw_line(r#"pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot;"#) + .raw_line(r#"pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>;"#) + .raw_line(r#"pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot;"#) + .raw_line(r#"pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>;"#) + .raw_line(r#"pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;"#) + .raw_line(r#"pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;"#) + .raw_line(r#"pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;"#) + .raw_line(r#"pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>;"#) + .raw_line(r#"pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;"#) + .raw_line(r#"pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;"#) + .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong;"#) + .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;"#) + .raw_line(r#"pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext;"#) + .raw_line(r#"pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>;"#) + .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList;"#) + .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>;"#) + .raw_line(r#"pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue;"#) + .raw_line(r#"pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>;"#) + .raw_line(r#"pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue;"#) + .raw_line(r#"pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>;"#) + .raw_line(r#"pub type nsTimingFunctionBorrowed<'a> = &'a nsTimingFunction;"#) + .raw_line(r#"pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>;"#) + .raw_line(r#"pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction;"#) + .raw_line(r#"pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>;"#) + .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment;"#) + .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>;"#) + .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment;"#) + .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>;"#) + .raw_line(r#"pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList;"#) + .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>;"#) + .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList;"#) + .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>;"#) + .raw_line(r#"pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming;"#) + .raw_line(r#"pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>;"#) + .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming;"#) + .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedTiming>;"#) + .raw_line(r#"pub type RawGeckoKeyframeListBorrowed<'a> = &'a RawGeckoKeyframeList;"#) + .raw_line(r#"pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeList>;"#) + .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList;"#) + .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>;"#) + .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList;"#) + .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>;"#) + .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList;"#) + .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>;"#) + .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList;"#) + .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>;"#) + .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList;"#) + .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>;"#) + .clang_arg("-x") + .clang_arg("c++") + .clang_arg("-std=c++14") + .clang_arg("-DTRACING=1") + .clang_arg("-DIMPL_LIBXUL") + .clang_arg("-DMOZ_STYLO_BINDINGS=1") + .clang_arg("-DMOZILLA_INTERNAL_API") + .clang_arg("-DRUST_BINDGEN") + .clang_arg("-DMOZ_STYLO") + .clang_arg("-DOS_POSIX=1") + .clang_arg("-DOS_LINUX=1") + .generate() + .expect("Should generate stylo bindings"); + + let now = Instant::now(); + + println!(""); + println!(""); + println!("Generated Stylo bindings in: {:?}", + now.duration_since(then)); + println!(""); + println!(""); + + // panic!("Uncomment this line to get timing logs"); +} -- cgit v1.2.3