1
1
//! Transforms `ast::Expr` into an equivalent `hir_def::expr::Expr`
2
2
//! representation.
3
3
4
- use std:: { mem, sync :: Arc } ;
4
+ use std:: mem;
5
5
6
6
use either:: Either ;
7
7
use hir_expand:: {
@@ -11,7 +11,6 @@ use hir_expand::{
11
11
} ;
12
12
use la_arena:: Arena ;
13
13
use profile:: Count ;
14
- use rustc_hash:: FxHashMap ;
15
14
use syntax:: {
16
15
ast:: {
17
16
self , ArgListOwner , ArrayExprKind , AstChildren , LiteralKind , LoopBodyOwner , NameOwner ,
@@ -32,7 +31,6 @@ use crate::{
32
31
Statement ,
33
32
} ,
34
33
item_scope:: BuiltinShadowMode ,
35
- item_tree:: ItemTree ,
36
34
path:: { GenericArgs , Path } ,
37
35
type_ref:: { Mutability , Rawness , TypeRef } ,
38
36
AdtId , BlockLoc , ModuleDefId ,
@@ -63,7 +61,6 @@ pub(super) fn lower(
63
61
params : Option < ast:: ParamList > ,
64
62
body : Option < ast:: Expr > ,
65
63
) -> ( Body , BodySourceMap ) {
66
- let item_tree = db. item_tree ( expander. current_file_id ) ;
67
64
ExprCollector {
68
65
db,
69
66
source_map : BodySourceMap :: default ( ) ,
@@ -76,11 +73,6 @@ pub(super) fn lower(
76
73
block_scopes : Vec :: new ( ) ,
77
74
_c : Count :: new ( ) ,
78
75
} ,
79
- item_trees : {
80
- let mut map = FxHashMap :: default ( ) ;
81
- map. insert ( expander. current_file_id , item_tree) ;
82
- map
83
- } ,
84
76
expander,
85
77
}
86
78
. collect ( params, body)
@@ -91,8 +83,6 @@ struct ExprCollector<'a> {
91
83
expander : Expander ,
92
84
body : Body ,
93
85
source_map : BodySourceMap ,
94
-
95
- item_trees : FxHashMap < HirFileId , Arc < ItemTree > > ,
96
86
}
97
87
98
88
impl ExprCollector < ' _ > {
@@ -589,9 +579,6 @@ impl ExprCollector<'_> {
589
579
} else {
590
580
self . source_map . expansions . insert ( macro_call, self . expander . current_file_id ) ;
591
581
592
- let item_tree = self . db . item_tree ( self . expander . current_file_id ) ;
593
- self . item_trees . insert ( self . expander . current_file_id , item_tree) ;
594
-
595
582
let id = collector ( self , Some ( expansion) ) ;
596
583
self . expander . exit ( self . db , mark) ;
597
584
id
0 commit comments