@@ -323,6 +323,7 @@ macro_rules! glib_object_wrapper {
323
323
#[ doc( hidden) ]
324
324
impl $crate:: translate:: FromGlibPtrNone <* mut $ffi_name> for $name {
325
325
#[ inline]
326
+ #[ cfg_attr( feature = "cargo-clippy" , allow( cast_ptr_alignment) ) ]
326
327
unsafe fn from_glib_none( ptr: * mut $ffi_name) -> Self {
327
328
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
328
329
$name( $crate:: translate:: from_glib_none( ptr as * mut _) , :: std:: marker:: PhantomData )
@@ -332,6 +333,7 @@ macro_rules! glib_object_wrapper {
332
333
#[ doc( hidden) ]
333
334
impl $crate:: translate:: FromGlibPtrNone <* const $ffi_name> for $name {
334
335
#[ inline]
336
+ #[ cfg_attr( feature = "cargo-clippy" , allow( cast_ptr_alignment) ) ]
335
337
unsafe fn from_glib_none( ptr: * const $ffi_name) -> Self {
336
338
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
337
339
$name( $crate:: translate:: from_glib_none( ptr as * mut _) , :: std:: marker:: PhantomData )
@@ -341,6 +343,7 @@ macro_rules! glib_object_wrapper {
341
343
#[ doc( hidden) ]
342
344
impl $crate:: translate:: FromGlibPtrFull <* mut $ffi_name> for $name {
343
345
#[ inline]
346
+ #[ cfg_attr( feature = "cargo-clippy" , allow( cast_ptr_alignment) ) ]
344
347
unsafe fn from_glib_full( ptr: * mut $ffi_name) -> Self {
345
348
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
346
349
$name( $crate:: translate:: from_glib_full( ptr as * mut _) , :: std:: marker:: PhantomData )
@@ -350,6 +353,7 @@ macro_rules! glib_object_wrapper {
350
353
#[ doc( hidden) ]
351
354
impl $crate:: translate:: FromGlibPtrBorrow <* mut $ffi_name> for $name {
352
355
#[ inline]
356
+ #[ cfg_attr( feature = "cargo-clippy" , allow( cast_ptr_alignment) ) ]
353
357
unsafe fn from_glib_borrow( ptr: * mut $ffi_name) -> Self {
354
358
debug_assert!( $crate:: types:: instance_of:: <Self >( ptr as * const _) ) ;
355
359
$name( $crate:: translate:: from_glib_borrow( ptr as * mut _) ,
@@ -464,13 +468,15 @@ macro_rules! glib_object_wrapper {
464
468
465
469
#[ doc( hidden) ]
466
470
impl $crate:: value:: SetValue for $name {
471
+ #[ cfg_attr( feature = "cargo-clippy" , allow( cast_ptr_alignment) ) ]
467
472
unsafe fn set_value( value: & mut $crate:: Value , this: & Self ) {
468
473
gobject_ffi:: g_value_set_object( value. to_glib_none_mut( ) . 0 , $crate:: translate:: ToGlibPtr :: <* mut $ffi_name>:: to_glib_none( this) . 0 as * mut gobject_ffi:: GObject )
469
474
}
470
475
}
471
476
472
477
#[ doc( hidden) ]
473
478
impl $crate:: value:: SetValueOptional for $name {
479
+ #[ cfg_attr( feature = "cargo-clippy" , allow( cast_ptr_alignment) ) ]
474
480
unsafe fn set_value_optional( value: & mut $crate:: Value , this: Option <& Self >) {
475
481
gobject_ffi:: g_value_set_object( value. to_glib_none_mut( ) . 0 , $crate:: translate:: ToGlibPtr :: <* mut $ffi_name>:: to_glib_none( & this) . 0 as * mut gobject_ffi:: GObject )
476
482
}
0 commit comments