Skip to content

codegen: Make phantom fields public. #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/anonymous-template-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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() } }
Expand Down
6 changes: 3 additions & 3 deletions tests/expectations/tests/class_nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down Expand Up @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/class_with_dtor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/const_tparam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/default-template-parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/forward-declaration-autoptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/inherit_named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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() } }
Expand All @@ -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() } }
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/issue-662-part-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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() } }
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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() } }
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/nsStyleAutoArray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/replace_template_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/replaces_double.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/template-param-usage-0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
8 changes: 4 additions & 4 deletions tests/expectations/tests/template-param-usage-10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() } }
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/template-param-usage-12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand All @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/template-param-usage-13.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/template-param-usage-15.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/template-param-usage-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
6 changes: 3 additions & 3 deletions tests/expectations/tests/template-param-usage-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/template-param-usage-4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/tests/template-param-usage-5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/tests/template-param-usage-7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() } }
Expand Down
Loading