File tree Expand file tree Collapse file tree 3 files changed +2
-22
lines changed
library/proc_macro/src/bridge Expand file tree Collapse file tree 3 files changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ macro_rules! define_client_side {
144
144
145
145
buf. clear( ) ;
146
146
api_tags:: Method :: $name( api_tags:: $name:: $method) . encode( & mut buf, & mut ( ) ) ;
147
- reverse_encode! ( buf ; $( $arg) , * ) ;
147
+ $( $arg. encode ( & mut buf , & mut ( ) ) ; ) *
148
148
149
149
buf = bridge. dispatch. call( buf) ;
150
150
Original file line number Diff line number Diff line change @@ -119,26 +119,6 @@ macro_rules! with_api_handle_types {
119
119
} ;
120
120
}
121
121
122
- // FIXME(eddyb) this calls `encode` for each argument, but in reverse,
123
- // to match the ordering in `reverse_decode`.
124
- macro_rules! reverse_encode {
125
- ( $writer: ident; ) => { } ;
126
- ( $writer: ident; $first: ident $( , $rest: ident) * ) => {
127
- reverse_encode!( $writer; $( $rest) ,* ) ;
128
- $first. encode( & mut $writer, & mut ( ) ) ;
129
- }
130
- }
131
-
132
- // FIXME(eddyb) this calls `decode` for each argument, but in reverse,
133
- // to avoid borrow conflicts from borrows started by `&mut` arguments.
134
- macro_rules! reverse_decode {
135
- ( $reader: ident, $s: ident; ) => { } ;
136
- ( $reader: ident, $s: ident; $first: ident: $first_ty: ty $( , $rest: ident: $rest_ty: ty) * ) => {
137
- reverse_decode!( $reader, $s; $( $rest: $rest_ty) ,* ) ;
138
- let $first = <$first_ty>:: decode( & mut $reader, $s) ;
139
- }
140
- }
141
-
142
122
#[ allow( unsafe_code) ]
143
123
mod arena;
144
124
#[ allow( unsafe_code) ]
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ macro_rules! define_dispatcher_impl {
178
178
$( api_tags:: Method :: $name( m) => match m {
179
179
$( api_tags:: $name:: $method => {
180
180
let mut call_method = || {
181
- reverse_decode! ( reader , handle_store ; $ ( $ arg: $arg_ty) , * ) ;
181
+ $ ( let $ arg = < $arg_ty> :: decode ( & mut reader , handle_store ) ; ) *
182
182
$name:: $method( server, $( $arg) ,* )
183
183
} ;
184
184
// HACK(eddyb) don't use `panic::catch_unwind` in a panic.
You can’t perform that action at this time.
0 commit comments