@@ -439,18 +439,20 @@ macro_rules! impl_union {
439439 unset_any_tag( self . raw, $mask)
440440 }
441441
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+ }
454456 }
455457 }
456458 }
@@ -463,9 +465,9 @@ macro_rules! impl_union {
463465 }
464466 }
465467
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 > {
469471 match self {
470472 $( $Enum:: $A( this) => $Union:: [ <new_ $a>] ( this) . map_err( Self :: $A) , ) *
471473 }
0 commit comments