@@ -518,10 +518,10 @@ impl Module {
518518
519519 DefDiagnosticKind :: UnresolvedProcMacro { ast } => {
520520 let mut precise_location = None ;
521- let ( file , ast , name) = match ast {
521+ let ( node , name) = match ast {
522522 MacroCallKind :: FnLike { ast_id, .. } => {
523523 let node = ast_id. to_node ( db. upcast ( ) ) ;
524- ( ast_id. file_id , SyntaxNodePtr :: from ( AstPtr :: new ( & node) ) , None )
524+ ( ast_id. with_value ( SyntaxNodePtr :: from ( AstPtr :: new ( & node) ) ) , None )
525525 }
526526 MacroCallKind :: Derive { ast_id, derive_name, .. } => {
527527 let node = ast_id. to_node ( db. upcast ( ) ) ;
@@ -554,8 +554,7 @@ impl Module {
554554 }
555555
556556 (
557- ast_id. file_id ,
558- SyntaxNodePtr :: from ( AstPtr :: new ( & node) ) ,
557+ ast_id. with_value ( SyntaxNodePtr :: from ( AstPtr :: new ( & node) ) ) ,
559558 Some ( derive_name. clone ( ) ) ,
560559 )
561560 }
@@ -566,18 +565,14 @@ impl Module {
566565 || panic ! ( "cannot find attribute #{}" , invoc_attr_index) ,
567566 ) ;
568567 (
569- ast_id. file_id ,
570- SyntaxNodePtr :: from ( AstPtr :: new ( & attr) ) ,
568+ ast_id. with_value ( SyntaxNodePtr :: from ( AstPtr :: new ( & attr) ) ) ,
571569 Some ( attr_name. clone ( ) ) ,
572570 )
573571 }
574572 } ;
575- sink. push ( UnresolvedProcMacro {
576- file,
577- node : ast,
578- precise_location,
579- macro_name : name,
580- } ) ;
573+ acc. push (
574+ UnresolvedProcMacro { node, precise_location, macro_name : name } . into ( ) ,
575+ ) ;
581576 }
582577
583578 DefDiagnosticKind :: UnresolvedMacroCall { ast, path } => {
@@ -1056,12 +1051,14 @@ impl Function {
10561051 node : node. value . clone ( ) . into ( ) ,
10571052 message : message. to_string ( ) ,
10581053 } ) ,
1059- BodyDiagnostic :: UnresolvedProcMacro { node } => sink. push ( UnresolvedProcMacro {
1060- file : node. file_id ,
1061- node : node. value . clone ( ) . into ( ) ,
1062- precise_location : None ,
1063- macro_name : None ,
1064- } ) ,
1054+ BodyDiagnostic :: UnresolvedProcMacro { node } => acc. push (
1055+ UnresolvedProcMacro {
1056+ node : node. clone ( ) . map ( |it| it. into ( ) ) ,
1057+ precise_location : None ,
1058+ macro_name : None ,
1059+ }
1060+ . into ( ) ,
1061+ ) ,
10651062 BodyDiagnostic :: UnresolvedMacroCall { node, path } => acc. push (
10661063 UnresolvedMacroCall { macro_call : node. clone ( ) , path : path. clone ( ) } . into ( ) ,
10671064 ) ,
0 commit comments