Skip to content

Commit c1d6dcd

Browse files
committed
remove useless phantom field from shared_wrapper and boxed_inline macros
1 parent 575d3ef commit c1d6dcd

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

glib/src/boxed.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ macro_rules! glib_boxed_wrapper {
3333
#[repr(transparent)]
3434
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
3535
inner: $crate::boxed::Boxed<$ffi_name, Self>,
36-
phantom: std::marker::PhantomData<($($($generic),+)?)>,
3736
}
3837

3938
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
4039
#[inline]
4140
fn clone(&self) -> Self {
4241
Self {
4342
inner: std::clone::Clone::clone(&self.inner),
44-
phantom: std::marker::PhantomData,
4543
}
4644
}
4745
}
@@ -145,7 +143,6 @@ macro_rules! glib_boxed_wrapper {
145143
unsafe fn from_glib_none(ptr: *mut $ffi_name) -> Self {
146144
Self {
147145
inner: $crate::translate::from_glib_none(ptr),
148-
phantom: std::marker::PhantomData,
149146
}
150147
}
151148
}
@@ -156,7 +153,6 @@ macro_rules! glib_boxed_wrapper {
156153
unsafe fn from_glib_none(ptr: *const $ffi_name) -> Self {
157154
Self {
158155
inner: $crate::translate::from_glib_none(ptr),
159-
phantom: std::marker::PhantomData,
160156
}
161157
}
162158
}
@@ -167,7 +163,6 @@ macro_rules! glib_boxed_wrapper {
167163
unsafe fn from_glib_full(ptr: *mut $ffi_name) -> Self {
168164
Self {
169165
inner: $crate::translate::from_glib_full(ptr),
170-
phantom: std::marker::PhantomData,
171166
}
172167
}
173168
}
@@ -178,7 +173,6 @@ macro_rules! glib_boxed_wrapper {
178173
unsafe fn from_glib_full(ptr: *const $ffi_name) -> Self {
179174
Self {
180175
inner: $crate::translate::from_glib_full(ptr),
181-
phantom: std::marker::PhantomData,
182176
}
183177
}
184178
}
@@ -190,7 +184,6 @@ macro_rules! glib_boxed_wrapper {
190184
$crate::translate::Borrowed::new(
191185
Self {
192186
inner: $crate::translate::from_glib_borrow::<_, $crate::boxed::Boxed<_, _>>(ptr).into_inner(),
193-
phantom: std::marker::PhantomData,
194187
}
195188
)
196189
}

glib/src/shared.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ macro_rules! glib_shared_wrapper {
3131
#[repr(transparent)]
3232
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
3333
inner: $crate::shared::Shared<$ffi_name, Self>,
34-
phantom: std::marker::PhantomData<($($($generic),+)?)>,
3534
}
3635

3736
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
3837
#[inline]
3938
fn clone(&self) -> Self {
4039
Self {
4140
inner: std::clone::Clone::clone(&self.inner),
42-
phantom: std::marker::PhantomData,
4341
}
4442
}
4543
}
@@ -146,7 +144,6 @@ macro_rules! glib_shared_wrapper {
146144
unsafe fn from_glib_none(ptr: *mut $ffi_name) -> Self {
147145
Self {
148146
inner: $crate::translate::from_glib_none(ptr),
149-
phantom: std::marker::PhantomData,
150147
}
151148
}
152149
}
@@ -157,7 +154,6 @@ macro_rules! glib_shared_wrapper {
157154
unsafe fn from_glib_none(ptr: *const $ffi_name) -> Self {
158155
Self {
159156
inner: $crate::translate::from_glib_none(ptr),
160-
phantom: std::marker::PhantomData,
161157
}
162158
}
163159
}
@@ -168,7 +164,6 @@ macro_rules! glib_shared_wrapper {
168164
unsafe fn from_glib_full(ptr: *mut $ffi_name) -> Self {
169165
Self {
170166
inner: $crate::translate::from_glib_full(ptr),
171-
phantom: std::marker::PhantomData,
172167
}
173168
}
174169
}
@@ -180,7 +175,6 @@ macro_rules! glib_shared_wrapper {
180175
$crate::translate::Borrowed::new(
181176
Self {
182177
inner: $crate::translate::from_glib_borrow::<_, $crate::shared::Shared<_, _>>(ptr).into_inner(),
183-
phantom: std::marker::PhantomData,
184178
}
185179
)
186180
}

0 commit comments

Comments
 (0)