@@ -26,18 +26,16 @@ macro_rules! define_client_handles {
26
26
$(
27
27
pub ( crate ) struct $oty {
28
28
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 ( ) >,
33
29
}
34
30
31
+ impl !Send for $oty { }
32
+ impl !Sync for $oty { }
33
+
35
34
// Forward `Drop::drop` to the inherent `drop` method.
36
35
impl Drop for $oty {
37
36
fn drop( & mut self ) {
38
37
$oty {
39
38
handle: self . handle,
40
- _marker: PhantomData ,
41
39
} . drop( ) ;
42
40
}
43
41
}
@@ -64,7 +62,6 @@ macro_rules! define_client_handles {
64
62
fn decode( r: & mut Reader <' _>, s: & mut S ) -> Self {
65
63
$oty {
66
64
handle: handle:: Handle :: decode( r, s) ,
67
- _marker: PhantomData ,
68
65
}
69
66
}
70
67
}
@@ -74,12 +71,11 @@ macro_rules! define_client_handles {
74
71
#[ derive( Copy , Clone , PartialEq , Eq , Hash ) ]
75
72
pub ( crate ) struct $ity {
76
73
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 ( ) >,
81
74
}
82
75
76
+ impl !Send for $ity { }
77
+ impl !Sync for $ity { }
78
+
83
79
impl <S > Encode <S > for $ity {
84
80
fn encode( self , w: & mut Writer , s: & mut S ) {
85
81
self . handle. encode( w, s) ;
@@ -90,7 +86,6 @@ macro_rules! define_client_handles {
90
86
fn decode( r: & mut Reader <' _>, s: & mut S ) -> Self {
91
87
$ity {
92
88
handle: handle:: Handle :: decode( r, s) ,
93
- _marker: PhantomData ,
94
89
}
95
90
}
96
91
}
@@ -144,7 +139,7 @@ macro_rules! define_client_side {
144
139
145
140
buf. clear( ) ;
146
141
api_tags:: Method :: $name( api_tags:: $name:: $method) . encode( & mut buf, & mut ( ) ) ;
147
- reverse_encode! ( buf ; $( $arg) , * ) ;
142
+ $( $arg. encode ( & mut buf , & mut ( ) ) ; ) *
148
143
149
144
buf = bridge. dispatch. call( buf) ;
150
145
0 commit comments