Skip to content

Commit

Permalink
Revert "fix warning about unnecessary parentheses in boxed_inline"
Browse files Browse the repository at this point in the history
This reverts commit daffb6d.

It broke API.
  • Loading branch information
sdroege committed Mar 8, 2022
1 parent 34a54da commit b6c7b9d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions glib/src/boxed_inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ macro_rules! glib_boxed_inline_wrapper {
#[repr(transparent)]
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
pub(crate) inner: $ffi_name,
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
}

impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
#[inline]
fn clone(&self) -> Self {
Self {
inner: std::clone::Clone::clone(&self.inner),
$(phantom: std::marker::PhantomData::<$($generic),+>)?
phantom: std::marker::PhantomData,
}
}
}
Expand All @@ -45,15 +45,15 @@ macro_rules! glib_boxed_inline_wrapper {
#[repr(transparent)]
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
pub(crate) inner: $ffi_name,
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
}

impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
#[inline]
fn clone(&self) -> Self {
Self {
inner: std::clone::Clone::clone(&self.inner),
$(phantom: std::marker::PhantomData::<$($generic),+>)?
phantom: std::marker::PhantomData,
}
}
}
Expand All @@ -76,7 +76,7 @@ macro_rules! glib_boxed_inline_wrapper {
#[repr(transparent)]
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
pub(crate) inner: $ffi_name,
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
}

impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
Expand Down Expand Up @@ -116,7 +116,7 @@ macro_rules! glib_boxed_inline_wrapper {
#[repr(transparent)]
$visibility struct $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? {
pub(crate) inner: $ffi_name,
$(pub(crate) phantom: std::marker::PhantomData<$($generic),+>,)?
pub(crate) phantom: std::marker::PhantomData<($($($generic),+)?)>,
}

impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::clone::Clone for $name $(<$($generic),+>)? {
Expand Down Expand Up @@ -164,7 +164,7 @@ macro_rules! glib_boxed_inline_wrapper {
init(v.as_mut_ptr());
Self {
inner: v.assume_init(),
$(phantom: std::marker::PhantomData::<$($generic),+>)?
phantom: std::marker::PhantomData,
}
}
}
Expand All @@ -174,7 +174,7 @@ macro_rules! glib_boxed_inline_wrapper {
unsafe fn unsafe_from(t: $ffi_name) -> Self {
Self {
inner: t,
$(phantom: std::marker::PhantomData::<$($generic),+>)?
phantom: std::marker::PhantomData,
}
}
}
Expand Down Expand Up @@ -372,7 +372,7 @@ macro_rules! glib_boxed_inline_wrapper {

$crate::translate::Borrowed::new(Self {
inner: std::ptr::read(ptr),
$(phantom: std::marker::PhantomData::<$($generic),+>)?
phantom: std::marker::PhantomData,
})
}
}
Expand Down

0 comments on commit b6c7b9d

Please sign in to comment.