Skip to content

Commit 08e6f30

Browse files
Merge pull request #879 from sdroege/boxed-inline-wrapper-generics
glib: Fix `glib::wrapper!` for `BoxedInline` with generic parameters
2 parents 9e7db4b + aa1abc2 commit 08e6f30

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

glib/src/boxed_inline.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro_rules! glib_boxed_inline_wrapper {
2929
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::marker::Copy for $name $(<$($generic),+>)? {}
3030

3131
$crate::glib_boxed_inline_wrapper!(
32-
@generic_impl [$($attr)*] $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
32+
@generic_impl $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
3333
@copy ptr unsafe { let copy = $crate::ffi::g_malloc(std::mem::size_of::<$ffi_name>()) as *mut $ffi_name; std::ptr::copy_nonoverlapping(ptr, copy, 1); copy },
3434
@free ptr unsafe { $crate::ffi::g_free(ptr as *mut _); },
3535
@init _ptr (), @copy_into dest src std::ptr::copy_nonoverlapping(src, dest, 1), @clear _ptr ()
@@ -61,7 +61,7 @@ macro_rules! glib_boxed_inline_wrapper {
6161
impl $(<$($generic $(: $bound $(+ $bound2)*)?),+>)? std::marker::Copy for $name $(<$($generic),+>)? {}
6262

6363
$crate::glib_boxed_inline_wrapper!(
64-
@generic_impl [$($attr)*] $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
64+
@generic_impl $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
6565
@copy $copy_arg $copy_expr, @free $free_arg $free_expr,
6666
@init _ptr (), @copy_into dest src std::ptr::copy_nonoverlapping(src, dest, 1), @clear _ptr ()
6767
);
@@ -99,7 +99,7 @@ macro_rules! glib_boxed_inline_wrapper {
9999
}
100100

101101
$crate::glib_boxed_inline_wrapper!(
102-
@generic_impl [$($attr)*] $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
102+
@generic_impl $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
103103
@copy ptr unsafe { let copy = $crate::ffi::g_malloc(std::mem::size_of::<$ffi_name>()) as *mut $ffi_name; let c = |$copy_into_arg_dest, $copy_into_arg_src| $copy_into_expr; c(copy, ptr); copy },
104104
@free ptr unsafe { let c = |$clear_arg| $clear_expr; c(ptr); $crate::ffi::g_free(ptr as *mut _); },
105105
@init $init_arg $init_expr, @copy_into $copy_into_arg_dest $copy_into_arg_src $copy_into_expr, @clear $clear_arg $clear_expr
@@ -140,15 +140,15 @@ macro_rules! glib_boxed_inline_wrapper {
140140
}
141141

142142
$crate::glib_boxed_inline_wrapper!(
143-
@generic_impl [$($attr)*] $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
143+
@generic_impl $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name,
144144
@copy $copy_arg $copy_expr, @free $free_arg $free_expr,
145145
@init $init_arg $init_expr, @copy_into $copy_into_arg_dest $copy_into_arg_src $copy_into_expr, @clear $clear_arg $clear_expr
146146
);
147147

148148
$crate::glib_boxed_inline_wrapper!(@value_impl $name $(<$($generic $(: $bound $(+ $bound2)*)?),+>)?, $ffi_name $(, @type_ $get_type_expr)?);
149149
};
150150

151-
(@generic_impl [$($attr:meta)*] $name:ident $(<$($generic:ident $(: $bound:tt $(+ $bound2:tt)*)?),+>)?, $ffi_name:ty,
151+
(@generic_impl $name:ident $(<$($generic:ident $(: $bound:tt $(+ $bound2:tt)*)?),+>)?, $ffi_name:ty,
152152
@copy $copy_arg:ident $copy_expr:expr, @free $free_arg:ident $free_expr:expr,
153153
@init $init_arg:ident $init_expr:expr, @copy_into $copy_into_arg_dest:ident $copy_into_arg_src:ident $copy_into_expr:expr, @clear $clear_arg:ident $clear_expr:expr) => {
154154

@@ -207,7 +207,7 @@ macro_rules! glib_boxed_inline_wrapper {
207207
}
208208

209209
#[doc(hidden)]
210-
impl<'a $(, $($generic: 'a + $($bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibPtr<'a, *const $ffi_name> for $name $(<$($generic),+>)? {
210+
impl<'a $(, $($generic $(: $bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibPtr<'a, *const $ffi_name> for $name $(<$($generic),+>)? {
211211
type Storage = std::marker::PhantomData<&'a Self>;
212212

213213
#[inline]
@@ -225,7 +225,7 @@ macro_rules! glib_boxed_inline_wrapper {
225225
}
226226

227227
#[doc(hidden)]
228-
impl<'a $(, $($generic: 'a + $($bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibPtrMut<'a, *mut $ffi_name> for $name $(<$($generic),+>)? {
228+
impl<'a $(, $($generic $(: $bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibPtrMut<'a, *mut $ffi_name> for $name $(<$($generic),+>)? {
229229
type Storage = std::marker::PhantomData<&'a mut Self>;
230230

231231
#[inline]
@@ -236,7 +236,7 @@ macro_rules! glib_boxed_inline_wrapper {
236236
}
237237

238238
#[doc(hidden)]
239-
impl<'a $(, $($generic: 'a + $($bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *mut *const $ffi_name> for $name $(<$($generic),+>)? {
239+
impl<'a $(, $($generic $(: $bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *mut *const $ffi_name> for $name $(<$($generic),+>)? {
240240
type Storage = (std::marker::PhantomData<&'a [Self]>, Option<Vec<*const $ffi_name>>);
241241

242242
fn to_glib_none_from_slice(t: &'a [Self]) -> (*mut *const $ffi_name, Self::Storage) {
@@ -276,7 +276,7 @@ macro_rules! glib_boxed_inline_wrapper {
276276
}
277277

278278
#[doc(hidden)]
279-
impl<'a $(, $($generic: 'a + $($bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *const *const $ffi_name> for $name $(<$($generic),+>)? {
279+
impl<'a $(, $($generic $(: $bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *const *const $ffi_name> for $name $(<$($generic),+>)? {
280280
type Storage = (std::marker::PhantomData<&'a [Self]>, Option<Vec<*const $ffi_name>>);
281281

282282
#[inline]
@@ -297,7 +297,7 @@ macro_rules! glib_boxed_inline_wrapper {
297297
}
298298

299299
#[doc(hidden)]
300-
impl<'a $(, $($generic: 'a + $($bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *mut $ffi_name> for $name $(<$($generic),+>)? {
300+
impl<'a $(, $($generic $(: $bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *mut $ffi_name> for $name $(<$($generic),+>)? {
301301
type Storage = std::marker::PhantomData<&'a [Self]>;
302302

303303
#[inline]
@@ -329,7 +329,7 @@ macro_rules! glib_boxed_inline_wrapper {
329329
}
330330

331331
#[doc(hidden)]
332-
impl<'a $(, $($generic: 'a $($bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *const $ffi_name> for $name $(<$($generic),+>)? {
332+
impl<'a $(, $($generic $(: $bound $(+ $bound2)*)?),+)?> $crate::translate::ToGlibContainerFromSlice<'a, *const $ffi_name> for $name $(<$($generic),+>)? {
333333
type Storage = std::marker::PhantomData<&'a [Self]>;
334334

335335
#[inline]

0 commit comments

Comments
 (0)