@@ -157,18 +157,18 @@ impl<'c> Translation<'c> {
157157
158158 // Find the first macro after the macro we're currently expanding, if any.
159159 let first_macro = macros
160- . splitn ( 2 , |macro_id | ctx. expanding_macro ( macro_id) )
160+ . splitn ( 2 , |info | ctx. expanding_macro ( & info . macro_id ) )
161161 . last ( )
162162 . unwrap ( )
163163 . first ( ) ;
164164 let macro_id = match first_macro {
165- Some ( macro_id ) => macro_id,
165+ Some ( info ) => info . macro_id ,
166166 None => return Ok ( None ) ,
167167 } ;
168168
169169 trace ! ( " found macro expansion: {macro_id:?}" ) ;
170170 // Ensure that we've converted this macro and that it has a valid definition.
171- let expansion = self . macro_expansions . borrow ( ) . get ( macro_id) . cloned ( ) ;
171+ let expansion = self . macro_expansions . borrow ( ) . get ( & macro_id) . cloned ( ) ;
172172 let macro_ty = match expansion {
173173 // Expansion exists.
174174 Some ( Some ( expansion) ) => expansion. ty ,
@@ -178,8 +178,8 @@ impl<'c> Translation<'c> {
178178
179179 // We haven't tried to expand it yet.
180180 None => {
181- self . convert_decl ( ctx, * macro_id) ?;
182- if let Some ( Some ( expansion) ) = self . macro_expansions . borrow ( ) . get ( macro_id) {
181+ self . convert_decl ( ctx, macro_id) ?;
182+ if let Some ( Some ( expansion) ) = self . macro_expansions . borrow ( ) . get ( & macro_id) {
183183 expansion. ty
184184 } else {
185185 return Ok ( None ) ;
@@ -189,10 +189,10 @@ impl<'c> Translation<'c> {
189189 let rust_name = self
190190 . renamer
191191 . borrow_mut ( )
192- . get ( macro_id)
192+ . get ( & macro_id)
193193 . ok_or_else ( || format_err ! ( "Macro name not declared" ) ) ?;
194194
195- self . add_import ( * macro_id, & rust_name) ;
195+ self . add_import ( macro_id, & rust_name) ;
196196
197197 let val = WithStmts :: new_val ( mk ( ) . path_expr ( vec ! [ rust_name] ) ) ;
198198
0 commit comments