@@ -230,13 +230,13 @@ enum MacroDirectiveKind {
230230 FnLike {
231231 ast_id : AstIdWithPath < ast:: MacroCall > ,
232232 expand_to : ExpandTo ,
233- call_site : Span ,
233+ ctxt : SyntaxContextId ,
234234 } ,
235235 Derive {
236236 ast_id : AstIdWithPath < ast:: Adt > ,
237237 derive_attr : AttrId ,
238238 derive_pos : usize ,
239- call_site : Span ,
239+ ctxt : SyntaxContextId ,
240240 } ,
241241 Attr {
242242 ast_id : AstIdWithPath < ast:: Item > ,
@@ -1126,7 +1126,7 @@ impl DefCollector<'_> {
11261126 let resolver_def_id = |path| resolver ( path) . map ( |( _, it) | it) ;
11271127
11281128 match & directive. kind {
1129- MacroDirectiveKind :: FnLike { ast_id, expand_to, call_site } => {
1129+ MacroDirectiveKind :: FnLike { ast_id, expand_to, ctxt : call_site } => {
11301130 let call_id = macro_call_as_call_id (
11311131 self . db . upcast ( ) ,
11321132 ast_id,
@@ -1146,7 +1146,7 @@ impl DefCollector<'_> {
11461146 return Resolved :: Yes ;
11471147 }
11481148 }
1149- MacroDirectiveKind :: Derive { ast_id, derive_attr, derive_pos, call_site } => {
1149+ MacroDirectiveKind :: Derive { ast_id, derive_attr, derive_pos, ctxt : call_site } => {
11501150 let id = derive_macro_as_call_id (
11511151 self . db ,
11521152 ast_id,
@@ -1266,7 +1266,7 @@ impl DefCollector<'_> {
12661266 ast_id,
12671267 derive_attr : attr. id ,
12681268 derive_pos : idx,
1269- call_site,
1269+ ctxt : call_site. ctx ,
12701270 } ,
12711271 container : directive. container ,
12721272 } ) ;
@@ -1428,7 +1428,7 @@ impl DefCollector<'_> {
14281428
14291429 for directive in & self . unresolved_macros {
14301430 match & directive. kind {
1431- MacroDirectiveKind :: FnLike { ast_id, expand_to, call_site } => {
1431+ MacroDirectiveKind :: FnLike { ast_id, expand_to, ctxt : call_site } => {
14321432 // FIXME: we shouldn't need to re-resolve the macro here just to get the unresolved error!
14331433 let macro_call_as_call_id = macro_call_as_call_id (
14341434 self . db . upcast ( ) ,
@@ -1460,7 +1460,7 @@ impl DefCollector<'_> {
14601460 ) ) ;
14611461 }
14621462 }
1463- MacroDirectiveKind :: Derive { ast_id, derive_attr, derive_pos, call_site : _ } => {
1463+ MacroDirectiveKind :: Derive { ast_id, derive_attr, derive_pos, ctxt : _ } => {
14641464 self . def_map . diagnostics . push ( DefDiagnostic :: unresolved_macro_call (
14651465 directive. module_id ,
14661466 MacroCallKind :: Derive {
@@ -2289,7 +2289,7 @@ impl ModCollector<'_, '_> {
22892289
22902290 fn collect_macro_call (
22912291 & mut self ,
2292- & MacroCall { ref path, ast_id, expand_to, call_site } : & MacroCall ,
2292+ & MacroCall { ref path, ast_id, expand_to, ctxt } : & MacroCall ,
22932293 container : ItemContainerId ,
22942294 ) {
22952295 let ast_id = AstIdWithPath :: new ( self . file_id ( ) , ast_id, ModPath :: clone ( path) ) ;
@@ -2303,7 +2303,7 @@ impl ModCollector<'_, '_> {
23032303 if let Ok ( res) = macro_call_as_call_id_with_eager (
23042304 db. upcast ( ) ,
23052305 & ast_id,
2306- call_site ,
2306+ ctxt ,
23072307 expand_to,
23082308 self . def_collector . def_map . krate ,
23092309 |path| {
@@ -2361,7 +2361,7 @@ impl ModCollector<'_, '_> {
23612361 self . def_collector . unresolved_macros . push ( MacroDirective {
23622362 module_id : self . module_id ,
23632363 depth : self . macro_depth + 1 ,
2364- kind : MacroDirectiveKind :: FnLike { ast_id, expand_to, call_site } ,
2364+ kind : MacroDirectiveKind :: FnLike { ast_id, expand_to, ctxt } ,
23652365 container,
23662366 } ) ;
23672367 }
0 commit comments