@@ -52,7 +52,7 @@ use crate::{
52
52
53
53
pub type ExpandResult < T > = ValueResult < T , ExpandError > ;
54
54
55
- #[ derive( Debug , PartialEq , Eq , Clone ) ]
55
+ #[ derive( Debug , PartialEq , Eq , Clone , Hash ) ]
56
56
pub enum ExpandError {
57
57
UnresolvedProcMacro ( CrateId ) ,
58
58
Mbe ( mbe:: ExpandError ) ,
@@ -114,7 +114,7 @@ impl_intern_key!(MacroCallId);
114
114
pub struct MacroCallLoc {
115
115
pub def : MacroDefId ,
116
116
pub ( crate ) krate : CrateId ,
117
- eager : Option < EagerCallInfo > ,
117
+ eager : Option < Box < EagerCallInfo > > ,
118
118
pub kind : MacroCallKind ,
119
119
}
120
120
@@ -141,6 +141,7 @@ struct EagerCallInfo {
141
141
/// NOTE: This can be *either* the expansion result, *or* the argument to the eager macro!
142
142
arg_or_expansion : Arc < tt:: Subtree > ,
143
143
included_file : Option < ( FileId , TokenMap ) > ,
144
+ error : Option < ExpandError > ,
144
145
}
145
146
146
147
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
@@ -206,8 +207,8 @@ impl HirFileId {
206
207
HirFileIdRepr :: FileId ( id) => break id,
207
208
HirFileIdRepr :: MacroFile ( MacroFile { macro_call_id } ) => {
208
209
let loc: MacroCallLoc = db. lookup_intern_macro_call ( macro_call_id) ;
209
- file_id = match loc. eager {
210
- Some ( EagerCallInfo { included_file : Some ( ( file, _) ) , .. } ) => file. into ( ) ,
210
+ file_id = match loc. eager . as_deref ( ) {
211
+ Some ( & EagerCallInfo { included_file : Some ( ( file, _) ) , .. } ) => file. into ( ) ,
211
212
_ => loc. kind . file_id ( ) ,
212
213
} ;
213
214
}
@@ -320,7 +321,7 @@ impl HirFileId {
320
321
match self . macro_file ( ) {
321
322
Some ( macro_file) => {
322
323
let loc: MacroCallLoc = db. lookup_intern_macro_call ( macro_file. macro_call_id ) ;
323
- matches ! ( loc. eager, Some ( EagerCallInfo { included_file: Some ( ..) , .. } ) )
324
+ matches ! ( loc. eager. as_deref ( ) , Some ( EagerCallInfo { included_file: Some ( ..) , .. } ) )
324
325
}
325
326
_ => false ,
326
327
}
0 commit comments