@@ -11,8 +11,7 @@ use ra_ap_hir::{
1111} ;
1212use ra_ap_hir_def:: ModuleId ;
1313use ra_ap_hir_def:: type_ref:: Mutability ;
14- use ra_ap_hir_expand:: files:: InFileWrapper ;
15- use ra_ap_hir_expand:: { ExpandError , ExpandResult , ExpandTo , InFile } ;
14+ use ra_ap_hir_expand:: { ExpandResult , ExpandTo , InFile } ;
1615use ra_ap_ide_db:: RootDatabase ;
1716use ra_ap_ide_db:: line_index:: { LineCol , LineIndex } ;
1817use ra_ap_parser:: SyntaxKind ;
@@ -844,8 +843,7 @@ impl<'a> Translator<'a> {
844843 fn process_item_macro_expansion (
845844 & mut self ,
846845 node : & impl ast:: AstNode ,
847- value : SyntaxNode ,
848- err : Option < ExpandError > ,
846+ ExpandResult { value, err } : ExpandResult < SyntaxNode > ,
849847 ) -> Option < Label < generated:: MacroItems > > {
850848 let semantics = self . semantics . unwrap ( ) ; // if we are here, we have semantics
851849 self . emit_macro_expansion_parse_errors ( node, & value) ;
@@ -888,11 +886,7 @@ impl<'a> Translator<'a> {
888886 return None ;
889887 }
890888 let expansion = self . semantics ?. expand_attr_macro ( node) ?;
891- let ExpandResult {
892- value : InFileWrapper { value, .. } ,
893- err,
894- } = expansion;
895- self . process_item_macro_expansion ( node, value, err)
889+ self . process_item_macro_expansion ( node, expansion. map ( |x| x. value ) )
896890 }
897891
898892 pub ( crate ) fn emit_item_expansion ( & mut self , node : & ast:: Item , label : Label < generated:: Item > ) {
@@ -934,9 +928,7 @@ impl<'a> Translator<'a> {
934928 . attrs ( )
935929 . filter_map ( |attr| semantics. expand_derive_macro ( & attr) )
936930 . flatten ( )
937- . filter_map ( |ExpandResult { value, err } | {
938- self . process_item_macro_expansion ( & node, value, err)
939- } )
931+ . filter_map ( |expanded| self . process_item_macro_expansion ( & node, expanded) )
940932 . collect :: < Vec < _ > > ( ) ;
941933 generated:: Adt :: emit_derive_macro_expansions (
942934 label. into ( ) ,
0 commit comments