@@ -52,7 +52,7 @@ use crate::{
5252
5353pub type ExpandResult < T > = ValueResult < T , ExpandError > ;
5454
55- #[ derive( Debug , PartialEq , Eq , Clone ) ]
55+ #[ derive( Debug , PartialEq , Eq , Clone , Hash ) ]
5656pub enum ExpandError {
5757 UnresolvedProcMacro ( CrateId ) ,
5858 Mbe ( mbe:: ExpandError ) ,
@@ -114,7 +114,7 @@ impl_intern_key!(MacroCallId);
114114pub struct MacroCallLoc {
115115 pub def : MacroDefId ,
116116 pub ( crate ) krate : CrateId ,
117- eager : Option < EagerCallInfo > ,
117+ eager : Option < Box < EagerCallInfo > > ,
118118 pub kind : MacroCallKind ,
119119}
120120
@@ -141,6 +141,7 @@ struct EagerCallInfo {
141141 /// NOTE: This can be *either* the expansion result, *or* the argument to the eager macro!
142142 arg_or_expansion : Arc < tt:: Subtree > ,
143143 included_file : Option < ( FileId , TokenMap ) > ,
144+ error : Option < ExpandError > ,
144145}
145146
146147#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
@@ -206,8 +207,8 @@ impl HirFileId {
206207 HirFileIdRepr :: FileId ( id) => break id,
207208 HirFileIdRepr :: MacroFile ( MacroFile { macro_call_id } ) => {
208209 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 ( ) ,
211212 _ => loc. kind . file_id ( ) ,
212213 } ;
213214 }
@@ -320,7 +321,7 @@ impl HirFileId {
320321 match self . macro_file ( ) {
321322 Some ( macro_file) => {
322323 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 ( ..) , .. } ) )
324325 }
325326 _ => false ,
326327 }
0 commit comments