@@ -11,8 +11,7 @@ use ra_ap_hir::{
11
11
} ;
12
12
use ra_ap_hir_def:: ModuleId ;
13
13
use 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 } ;
16
15
use ra_ap_ide_db:: RootDatabase ;
17
16
use ra_ap_ide_db:: line_index:: { LineCol , LineIndex } ;
18
17
use ra_ap_parser:: SyntaxKind ;
@@ -844,8 +843,7 @@ impl<'a> Translator<'a> {
844
843
fn process_item_macro_expansion (
845
844
& mut self ,
846
845
node : & impl ast:: AstNode ,
847
- value : SyntaxNode ,
848
- err : Option < ExpandError > ,
846
+ ExpandResult { value, err } : ExpandResult < SyntaxNode > ,
849
847
) -> Option < Label < generated:: MacroItems > > {
850
848
let semantics = self . semantics . unwrap ( ) ; // if we are here, we have semantics
851
849
self . emit_macro_expansion_parse_errors ( node, & value) ;
@@ -888,11 +886,7 @@ impl<'a> Translator<'a> {
888
886
return None ;
889
887
}
890
888
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 ) )
896
890
}
897
891
898
892
pub ( crate ) fn emit_item_expansion ( & mut self , node : & ast:: Item , label : Label < generated:: Item > ) {
@@ -934,9 +928,7 @@ impl<'a> Translator<'a> {
934
928
. attrs ( )
935
929
. filter_map ( |attr| semantics. expand_derive_macro ( & attr) )
936
930
. 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) )
940
932
. collect :: < Vec < _ > > ( ) ;
941
933
generated:: Adt :: emit_derive_macro_expansions (
942
934
label. into ( ) ,
0 commit comments