@@ -26,18 +26,16 @@ macro_rules! define_client_handles {
2626 $(
2727 pub ( crate ) struct $oty {
2828 handle: handle:: Handle ,
29- // Prevent Send and Sync impls. `!Send`/`!Sync` is the usual
30- // way of doing this, but that requires unstable features.
31- // rust-analyzer uses this code and avoids unstable features.
32- _marker: PhantomData <* mut ( ) >,
3329 }
3430
31+ impl !Send for $oty { }
32+ impl !Sync for $oty { }
33+
3534 // Forward `Drop::drop` to the inherent `drop` method.
3635 impl Drop for $oty {
3736 fn drop( & mut self ) {
3837 $oty {
3938 handle: self . handle,
40- _marker: PhantomData ,
4139 } . drop( ) ;
4240 }
4341 }
@@ -64,7 +62,6 @@ macro_rules! define_client_handles {
6462 fn decode( r: & mut Reader <' _>, s: & mut S ) -> Self {
6563 $oty {
6664 handle: handle:: Handle :: decode( r, s) ,
67- _marker: PhantomData ,
6865 }
6966 }
7067 }
@@ -74,12 +71,11 @@ macro_rules! define_client_handles {
7471 #[ derive( Copy , Clone , PartialEq , Eq , Hash ) ]
7572 pub ( crate ) struct $ity {
7673 handle: handle:: Handle ,
77- // Prevent Send and Sync impls. `!Send`/`!Sync` is the usual
78- // way of doing this, but that requires unstable features.
79- // rust-analyzer uses this code and avoids unstable features.
80- _marker: PhantomData <* mut ( ) >,
8174 }
8275
76+ impl !Send for $ity { }
77+ impl !Sync for $ity { }
78+
8379 impl <S > Encode <S > for $ity {
8480 fn encode( self , w: & mut Writer , s: & mut S ) {
8581 self . handle. encode( w, s) ;
@@ -90,7 +86,6 @@ macro_rules! define_client_handles {
9086 fn decode( r: & mut Reader <' _>, s: & mut S ) -> Self {
9187 $ity {
9288 handle: handle:: Handle :: decode( r, s) ,
93- _marker: PhantomData ,
9489 }
9590 }
9691 }
@@ -144,7 +139,7 @@ macro_rules! define_client_side {
144139
145140 buf. clear( ) ;
146141 api_tags:: Method :: $name( api_tags:: $name:: $method) . encode( & mut buf, & mut ( ) ) ;
147- reverse_encode! ( buf ; $( $arg) , * ) ;
142+ $( $arg. encode ( & mut buf , & mut ( ) ) ; ) *
148143
149144 buf = bridge. dispatch. call( buf) ;
150145
0 commit comments