diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-05-08 23:41:32 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-05-08 23:45:26 +0200 |
commit | 31e440917cdc8ac57cd69ddf929e90a7c4b46367 (patch) | |
tree | bec52d4264d736917634dad523c780ffedfcee34 | |
parent | 2d88dd106bf33807679f531051546f3c9889161e (diff) |
codegen: Make phantom fields public.v0.25.0
Otherwise you can't construct structs outside of the bindings file, which is
breaking.
Also, given the previous change was breaking and I didn't notice, I yanked
0.24.1.
40 files changed, 73 insertions, 72 deletions
@@ -1,6 +1,6 @@ [root] name = "bindgen" -version = "0.24.1" +version = "0.25.0" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -13,7 +13,7 @@ name = "bindgen" readme = "README.md" repository = "https://github.com/servo/rust-bindgen" documentation = "https://docs.rs/bindgen" -version = "0.24.1" +version = "0.25.0" build = "build.rs" exclude = [ diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 7f0a822a..6f9685b5 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1477,6 +1477,7 @@ impl CodeGenerator for CompInfo { ctx.ext_cx(), ::$prefix::marker::PhantomData<::$prefix::cell::UnsafeCell<$ident>>); let phantom_field = StructFieldBuilder::named(format!("_phantom_{}", idx)) + .pub_() .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 50604a3f..1dcd7e97 100644 --- a/tests/expectations/tests/anonymous-template-types.rs +++ b/tests/expectations/tests/anonymous-template-types.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct Foo<T> { pub t_member: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Foo<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -22,7 +22,7 @@ pub struct Bar { #[derive(Debug, Copy, Clone)] pub struct Quux<V> { pub v_member: V, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>, } impl <V> Default for Quux<V> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs index 8446cbcd..77072354 100644 --- a/tests/expectations/tests/class_nested.rs +++ b/tests/expectations/tests/class_nested.rs @@ -53,7 +53,7 @@ impl Clone for A_C { #[derive(Debug, Copy, Clone)] pub struct A_D<T> { pub foo: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for A_D<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -116,13 +116,13 @@ impl Clone for D { #[derive(Debug, Copy, Clone)] pub struct Templated<T> { pub member: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Templated_Templated_inner<T> { pub member_ptr: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Templated_Templated_inner<T> { 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 3b15b891..a3210247 100644 --- a/tests/expectations/tests/class_with_dtor.rs +++ b/tests/expectations/tests/class_with_dtor.rs @@ -8,7 +8,7 @@ #[derive(Debug)] pub struct HandleWithDtor<T> { pub ptr: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for HandleWithDtor<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/const_tparam.rs b/tests/expectations/tests/const_tparam.rs index 7600e18e..983958af 100644 --- a/tests/expectations/tests/const_tparam.rs +++ b/tests/expectations/tests/const_tparam.rs @@ -9,7 +9,7 @@ pub struct C<T> { pub foo: *const T, pub bar: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for C<T> { 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 c098dac7..3b65075c 100644 --- a/tests/expectations/tests/default-template-parameter.rs +++ b/tests/expectations/tests/default-template-parameter.rs @@ -9,8 +9,8 @@ pub struct Foo<T, U> { pub t: T, pub u: U, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <T, U> Default for Foo<T, U> { 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 e129e0fb..08ee31ef 100644 --- a/tests/expectations/tests/forward-declaration-autoptr.rs +++ b/tests/expectations/tests/forward-declaration-autoptr.rs @@ -13,7 +13,7 @@ pub struct Foo { #[derive(Debug, Copy, Clone)] pub struct RefPtr<T> { pub m_inner: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for RefPtr<T> { 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 1b31f62b..77a43405 100644 --- a/tests/expectations/tests/forward-inherit-struct-with-fields.rs +++ b/tests/expectations/tests/forward-inherit-struct-with-fields.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct Rooted<T> { pub _base: js_RootedBase<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Rooted<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -18,7 +18,7 @@ impl <T> Default for Rooted<T> { pub struct js_RootedBase<T> { pub foo: *mut T, pub next: *mut Rooted<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for js_RootedBase<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/inherit_named.rs b/tests/expectations/tests/inherit_named.rs index a641de70..4951a1c6 100644 --- a/tests/expectations/tests/inherit_named.rs +++ b/tests/expectations/tests/inherit_named.rs @@ -13,7 +13,7 @@ pub struct Wohoo { #[derive(Debug, Copy, Clone)] pub struct Weeee<T> { pub _base: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Weeee<T> { 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 ddcaf3fc..b1af2b8c 100644 --- a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs +++ b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs @@ -43,7 +43,7 @@ impl Clone for A { #[derive(Debug, Copy, Clone)] pub struct e<c> { pub d: RefPtr<c>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<c>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<c>>, } impl <c> Default for e<c> { 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 3afaf62d..0b28a558 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,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct RefPtr<T> { pub use_of_t: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for RefPtr<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -17,7 +17,7 @@ impl <T> Default for RefPtr<T> { #[derive(Debug, Copy, Clone)] pub struct UsesRefPtrWithAliasedTypeParam<U> { pub member: RefPtr<UsesRefPtrWithAliasedTypeParam_V<U>>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } pub type UsesRefPtrWithAliasedTypeParam_V<U> = U; impl <U> Default for UsesRefPtrWithAliasedTypeParam<U> { 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 c9695b69..68c07647 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,7 +9,7 @@ #[derive(Debug, Copy, Clone)] pub struct HasRefPtr<T> { pub refptr_member: RefPtr<HasRefPtr_TypedefOfT<T>>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } pub type HasRefPtr_TypedefOfT<T> = T; impl <T> Default for HasRefPtr<T> { 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 4a81f24e..7ee918a3 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,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct RefPtr<T> { pub a: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for RefPtr<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -17,7 +17,7 @@ impl <T> Default for RefPtr<T> { #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHolder<T> { pub a: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for nsMainThreadPtrHolder<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -26,7 +26,7 @@ impl <T> Default for nsMainThreadPtrHolder<T> { #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHandle<T> { pub mPtr: RefPtr<nsMainThreadPtrHolder<T>>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for nsMainThreadPtrHandle<T> { 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 eb9a34d1..52a9cafc 100644 --- a/tests/expectations/tests/issue-662-part-2.rs +++ b/tests/expectations/tests/issue-662-part-2.rs @@ -9,7 +9,7 @@ #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHolder<T> { pub a: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for nsMainThreadPtrHolder<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -18,7 +18,7 @@ impl <T> Default for nsMainThreadPtrHolder<T> { #[derive(Debug, Copy, Clone)] pub struct nsMainThreadPtrHandle<U> { pub mPtr: RefPtr<nsMainThreadPtrHolder<U>>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <U> Default for nsMainThreadPtrHandle<U> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs index 86d5e892..0fca8d72 100644 --- a/tests/expectations/tests/namespace.rs +++ b/tests/expectations/tests/namespace.rs @@ -69,7 +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<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for C<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -82,7 +82,7 @@ pub mod root { #[derive(Debug)] pub struct D<T> { pub m_c: root::C<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for D<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/nsStyleAutoArray.rs b/tests/expectations/tests/nsStyleAutoArray.rs index 04f01c0c..ea68980d 100644 --- a/tests/expectations/tests/nsStyleAutoArray.rs +++ b/tests/expectations/tests/nsStyleAutoArray.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct nsTArray<T> { pub mBuff: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for nsTArray<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -18,7 +18,7 @@ impl <T> Default for nsTArray<T> { pub struct nsStyleAutoArray<T> { pub mFirstElement: T, pub mOtherElements: nsTArray<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } #[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 65a5332b..4de44d25 100644 --- a/tests/expectations/tests/replace_template_alias.rs +++ b/tests/expectations/tests/replace_template_alias.rs @@ -12,7 +12,7 @@ pub type JS_detail_MaybeWrapped<T> = T; #[derive(Debug, Copy, Clone)] pub struct JS_Rooted<T> { pub ptr: JS_detail_MaybeWrapped<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for JS_Rooted<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/replaces_double.rs b/tests/expectations/tests/replaces_double.rs index f7093d3d..f3bc0bf4 100644 --- a/tests/expectations/tests/replaces_double.rs +++ b/tests/expectations/tests/replaces_double.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct Rooted<T> { pub ptr: Rooted_MaybeWrapped<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } /** * <div rustbindgen replaces="Rooted_MaybeWrapped"></div> diff --git a/tests/expectations/tests/template-param-usage-0.rs b/tests/expectations/tests/template-param-usage-0.rs index a36d729a..c782132b 100644 --- a/tests/expectations/tests/template-param-usage-0.rs +++ b/tests/expectations/tests/template-param-usage-0.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter<T> { pub t: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for UsesTemplateParameter<T> { 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 d41740cd..bee2ffd0 100644 --- a/tests/expectations/tests/template-param-usage-10.rs +++ b/tests/expectations/tests/template-param-usage-10.rs @@ -8,8 +8,8 @@ #[derive(Debug, Copy, Clone)] pub struct DoublyIndirectUsage<T, U> { pub doubly_indirect: DoublyIndirectUsage_IndirectUsage<T, U>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } pub type DoublyIndirectUsage_Aliased<T> = T; pub type DoublyIndirectUsage_Typedefed<U> = U; @@ -18,8 +18,8 @@ pub type DoublyIndirectUsage_Typedefed<U> = U; pub struct DoublyIndirectUsage_IndirectUsage<T, U> { pub member: DoublyIndirectUsage_Aliased<T>, pub another: DoublyIndirectUsage_Typedefed<U>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <T, U> Default for DoublyIndirectUsage_IndirectUsage<T, U> { 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 fcf10615..0823de1e 100644 --- a/tests/expectations/tests/template-param-usage-12.rs +++ b/tests/expectations/tests/template-param-usage-12.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct BaseUsesT<T> { pub t: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for BaseUsesT<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -18,7 +18,7 @@ impl <T> Default for BaseUsesT<T> { pub struct CrtpUsesU<U> { pub _base: BaseUsesT<CrtpUsesU<U>>, pub usage: U, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <U> Default for CrtpUsesU<U> { 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 10e45ed1..0d850c7b 100644 --- a/tests/expectations/tests/template-param-usage-13.rs +++ b/tests/expectations/tests/template-param-usage-13.rs @@ -14,7 +14,7 @@ pub struct BaseIgnoresT { pub struct CrtpUsesU<U> { pub _base: BaseIgnoresT, pub usage: U, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <U> Default for CrtpUsesU<U> { 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 77667b45..060c6e07 100644 --- a/tests/expectations/tests/template-param-usage-15.rs +++ b/tests/expectations/tests/template-param-usage-15.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct BaseUsesT<T> { pub usage: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for BaseUsesT<T> { 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 4f5987a1..008826b6 100644 --- a/tests/expectations/tests/template-param-usage-2.rs +++ b/tests/expectations/tests/template-param-usage-2.rs @@ -8,13 +8,13 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter<T> { pub t: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter_AlsoUsesTemplateParameter<T> { pub also: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for UsesTemplateParameter_AlsoUsesTemplateParameter<T> { 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 07571dcc..5a94b95d 100644 --- a/tests/expectations/tests/template-param-usage-3.rs +++ b/tests/expectations/tests/template-param-usage-3.rs @@ -8,15 +8,15 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter<T> { pub t: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter_AlsoUsesTemplateParameterAndMore<T, U> { pub also: T, pub more: U, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <T, U> Default for UsesTemplateParameter_AlsoUsesTemplateParameterAndMore<T, U> { diff --git a/tests/expectations/tests/template-param-usage-4.rs b/tests/expectations/tests/template-param-usage-4.rs index 7b8fe9f1..f95a4c60 100644 --- a/tests/expectations/tests/template-param-usage-4.rs +++ b/tests/expectations/tests/template-param-usage-4.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct UsesTemplateParameter<T> { pub t: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } #[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 3efdfac3..d719dbc8 100644 --- a/tests/expectations/tests/template-param-usage-5.rs +++ b/tests/expectations/tests/template-param-usage-5.rs @@ -8,7 +8,7 @@ #[derive(Debug, Copy, Clone)] pub struct IndirectlyUsesTemplateParameter<T> { pub aliased: IndirectlyUsesTemplateParameter_Aliased<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } pub type IndirectlyUsesTemplateParameter_Aliased<T> = T; impl <T> Default for IndirectlyUsesTemplateParameter<T> { diff --git a/tests/expectations/tests/template-param-usage-7.rs b/tests/expectations/tests/template-param-usage-7.rs index 3d1378ad..326917fc 100644 --- a/tests/expectations/tests/template-param-usage-7.rs +++ b/tests/expectations/tests/template-param-usage-7.rs @@ -9,8 +9,8 @@ pub struct DoesNotUseU<T, V> { pub t: T, pub v: V, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>, } impl <T, V> Default for DoesNotUseU<T, V> { 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 322c7257..55c39e19 100644 --- a/tests/expectations/tests/template-param-usage-8.rs +++ b/tests/expectations/tests/template-param-usage-8.rs @@ -9,8 +9,8 @@ pub struct IndirectUsage<T, U> { pub member1: IndirectUsage_Typedefed<T>, pub member2: IndirectUsage_Aliased<U>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } pub type IndirectUsage_Typedefed<T> = T; pub type IndirectUsage_Aliased<U> = U; diff --git a/tests/expectations/tests/template-param-usage-9.rs b/tests/expectations/tests/template-param-usage-9.rs index 5f2319c4..ec6c66b2 100644 --- a/tests/expectations/tests/template-param-usage-9.rs +++ b/tests/expectations/tests/template-param-usage-9.rs @@ -16,8 +16,8 @@ pub type DoesNotUse_Typedefed<U> = U; pub struct DoesNotUse_IndirectUsage<T, U> { pub member: DoesNotUse_Aliased<T>, pub another: DoesNotUse_Typedefed<U>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, - _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <T, U> Default for DoesNotUse_IndirectUsage<T, U> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs index 682c6db9..d4f81711 100644 --- a/tests/expectations/tests/template.rs +++ b/tests/expectations/tests/template.rs @@ -10,7 +10,7 @@ pub struct Foo<T> { pub m_member: T, pub m_member_ptr: *mut T, pub m_member_arr: [T; 1usize], - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Foo<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -30,7 +30,7 @@ pub type D_MyFoo = Foo<::std::os::raw::c_int>; pub struct D_U<Z> { pub m_nested_foo: D_MyFoo, pub m_baz: Z, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<Z>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<Z>>, } impl <Z> Default for D_U<Z> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -44,7 +44,7 @@ pub struct Rooted<T> { 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<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Rooted<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -76,7 +76,7 @@ impl Default for RootedContainer { #[derive(Debug)] pub struct WithDtor<T> { pub member: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for WithDtor<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -137,7 +137,7 @@ impl Clone for POD { #[derive(Debug, Copy, Clone)] pub struct NestedReplaced<T> { pub buff: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for NestedReplaced<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -146,7 +146,7 @@ impl <T> Default for NestedReplaced<T> { #[derive(Debug, Copy, Clone)] pub struct NestedBase<T> { pub buff: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for NestedBase<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -155,7 +155,7 @@ impl <T> Default for NestedBase<T> { #[derive(Debug, Copy, Clone)] pub struct Incomplete<T> { pub d: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Incomplete<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -166,7 +166,7 @@ pub struct NestedContainer<T> { pub c: T, pub nested: NestedReplaced<T>, pub inc: Incomplete<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for NestedContainer<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -201,7 +201,7 @@ pub struct Templated { #[derive(Debug)] pub struct ReplacedWithoutDestructor<T> { pub buff: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for ReplacedWithoutDestructor<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -210,7 +210,7 @@ impl <T> Default for ReplacedWithoutDestructor<T> { #[derive(Debug)] pub struct ShouldNotBeCopiable<T> { pub m_member: ReplacedWithoutDestructor<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for ShouldNotBeCopiable<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -219,7 +219,7 @@ impl <T> Default for ShouldNotBeCopiable<T> { #[derive(Debug)] pub struct ShouldNotBeCopiableAsWell<U> { pub m_member: ReplacedWithoutDestructorFwd<U>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, } impl <U> Default for ShouldNotBeCopiableAsWell<U> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } @@ -234,7 +234,7 @@ impl <U> Default for ShouldNotBeCopiableAsWell<U> { #[derive(Debug)] pub struct ReplacedWithoutDestructorFwd<T> { pub buff: *mut T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for ReplacedWithoutDestructorFwd<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template_alias.rs b/tests/expectations/tests/template_alias.rs index f98d165d..c440c278 100644 --- a/tests/expectations/tests/template_alias.rs +++ b/tests/expectations/tests/template_alias.rs @@ -9,7 +9,7 @@ pub type JS_detail_Wrapped<T> = T; #[derive(Debug, Copy, Clone)] pub struct JS_Rooted<T> { pub ptr: JS_detail_Wrapped<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for JS_Rooted<T> { 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 491bb68c..dfcbe367 100644 --- a/tests/expectations/tests/template_alias_namespace.rs +++ b/tests/expectations/tests/template_alias_namespace.rs @@ -20,7 +20,7 @@ pub mod root { #[derive(Debug, Copy, Clone)] pub struct Rooted<T> { pub ptr: root::JS::detail::Wrapped<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Rooted<T> { 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 5f6b4c38..cc360cd1 100644 --- a/tests/expectations/tests/template_typedef_transitive_param.rs +++ b/tests/expectations/tests/template_typedef_transitive_param.rs @@ -13,7 +13,7 @@ pub struct Wrapper { #[derive(Debug, Copy, Clone)] pub struct Wrapper_Wrapped<T> { pub t: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Wrapper_Wrapped<T> { 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 09c32486..a3970c68 100644 --- a/tests/expectations/tests/type_alias_partial_template_especialization.rs +++ b/tests/expectations/tests/type_alias_partial_template_especialization.rs @@ -9,7 +9,7 @@ pub type MaybeWrapped<A> = A; #[derive(Debug, Copy, Clone)] pub struct Rooted<T> { pub ptr: MaybeWrapped<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Rooted<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/using.rs b/tests/expectations/tests/using.rs index 44376b93..2997bcf5 100644 --- a/tests/expectations/tests/using.rs +++ b/tests/expectations/tests/using.rs @@ -9,7 +9,7 @@ pub struct Point<T> { pub x: T, pub y: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for Point<T> { 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 fa56f04b..388fe472 100644 --- a/tests/expectations/tests/what_is_going_on.rs +++ b/tests/expectations/tests/what_is_going_on.rs @@ -25,7 +25,7 @@ pub type Float = f32; pub struct PointTyped<F> { pub x: F, pub y: F, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<F>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<F>>, } impl <F> Default for PointTyped<F> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/whitelist_basic.rs b/tests/expectations/tests/whitelist_basic.rs index a83f0273..0eeeba4e 100644 --- a/tests/expectations/tests/whitelist_basic.rs +++ b/tests/expectations/tests/whitelist_basic.rs @@ -9,13 +9,13 @@ pub struct WhitelistMe<T> { pub foo: ::std::os::raw::c_int, pub bar: WhitelistMe_Inner<T>, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct WhitelistMe_Inner<T> { pub bar: T, - _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl <T> Default for WhitelistMe_Inner<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } |