@@ -210,7 +210,7 @@ pub fn expand_speculative(
210
210
let mut speculative_expansion = match loc. def . kind {
211
211
MacroDefKind :: ProcMacro ( expander, ..) => {
212
212
tt. delimiter = tt:: Delimiter :: unspecified ( ) ;
213
- expander. expand ( db, loc. krate , & tt, attr_arg. as_ref ( ) )
213
+ expander. expand ( db, loc. def . krate , loc . krate , & tt, attr_arg. as_ref ( ) )
214
214
}
215
215
MacroDefKind :: BuiltInAttr ( BuiltinAttrExpander :: Derive , _) => {
216
216
pseudo_derive_attr_expansion ( & tt, attr_arg. as_ref ( ) ?)
@@ -256,9 +256,9 @@ fn parse_macro_expansion(
256
256
macro_file : MacroFile ,
257
257
) -> ExpandResult < Option < ( Parse < SyntaxNode > , Arc < mbe:: TokenMap > ) > > {
258
258
let _p = profile:: span ( "parse_macro_expansion" ) ;
259
- let result = db. macro_expand ( macro_file. macro_call_id ) ;
259
+ let mbe :: ValueResult { value , err } = db. macro_expand ( macro_file. macro_call_id ) ;
260
260
261
- if let Some ( err) = & result . err {
261
+ if let Some ( err) = & err {
262
262
// Note:
263
263
// The final goal we would like to make all parse_macro success,
264
264
// such that the following log will not call anyway.
@@ -279,9 +279,9 @@ fn parse_macro_expansion(
279
279
parents
280
280
) ;
281
281
}
282
- let tt = match result . value {
282
+ let tt = match value {
283
283
Some ( tt) => tt,
284
- None => return ExpandResult { value : None , err : result . err } ,
284
+ None => return ExpandResult { value : None , err } ,
285
285
} ;
286
286
287
287
let expand_to = macro_expand_to ( db, macro_file. macro_call_id ) ;
@@ -291,7 +291,7 @@ fn parse_macro_expansion(
291
291
292
292
let ( parse, rev_token_map) = token_tree_to_syntax_node ( & tt, expand_to) ;
293
293
294
- ExpandResult { value : Some ( ( parse, Arc :: new ( rev_token_map) ) ) , err : result . err }
294
+ ExpandResult { value : Some ( ( parse, Arc :: new ( rev_token_map) ) ) , err }
295
295
}
296
296
297
297
fn macro_arg (
@@ -504,7 +504,7 @@ fn expand_proc_macro(db: &dyn ExpandDatabase, id: MacroCallId) -> ExpandResult<t
504
504
_ => None ,
505
505
} ;
506
506
507
- expander. expand ( db, loc. krate , & macro_arg. 0 , attr_arg. as_ref ( ) )
507
+ expander. expand ( db, loc. def . krate , loc . krate , & macro_arg. 0 , attr_arg. as_ref ( ) )
508
508
}
509
509
510
510
fn hygiene_frame ( db : & dyn ExpandDatabase , file_id : HirFileId ) -> Arc < HygieneFrame > {
0 commit comments