@@ -439,18 +439,20 @@ macro_rules! impl_union {
439
439
unset_any_tag( self . raw, $mask)
440
440
}
441
441
442
- /// Dereference the current pointer.
443
- ///
444
- /// Performs a dynamic alignment check on the dereferenced pointer.
445
- pub fn try_deref<' a>( & ' a self ) -> Option <$Union<$( & ' a $A:: Target ) ,* >>
446
- where
447
- $( $A: Deref , ) *
448
- $( & ' a $A:: Target : ErasablePtr , ) *
449
- {
450
- $( if let Some ( this) = self . $a( ) {
451
- paste:: paste! { $Union:: [ <new_ $a>] ( this) . ok( ) }
452
- } else) * {
453
- None
442
+ paste:: paste! {
443
+ /// Dereference the current pointer.
444
+ ///
445
+ /// Performs a dynamic alignment check on the dereferenced pointer.
446
+ pub fn try_deref<' a>( & ' a self ) -> Option <$Union<$( & ' a $A:: Target ) ,* >>
447
+ where
448
+ $( $A: Deref , ) *
449
+ $( & ' a $A:: Target : ErasablePtr , ) *
450
+ {
451
+ $( if let Some ( this) = self . $a( ) {
452
+ $Union:: [ <new_ $a>] ( this) . ok( )
453
+ } else) * {
454
+ None
455
+ }
454
456
}
455
457
}
456
458
}
@@ -463,9 +465,9 @@ macro_rules! impl_union {
463
465
}
464
466
}
465
467
466
- /// Pack this loose enum into a pointer union.
467
- pub fn try_pack ( self ) -> Result <$Union<$ ( $A ) , * > , Self > {
468
- paste :: paste! {
468
+ paste :: paste! {
469
+ /// Pack this loose enum into a pointer union.
470
+ pub fn try_pack ( self ) -> Result <$Union<$ ( $A ) , * > , Self > {
469
471
match self {
470
472
$( $Enum:: $A( this) => $Union:: [ <new_ $a>] ( this) . map_err( Self :: $A) , ) *
471
473
}
0 commit comments