diff options
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/body.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 7 |
2 files changed, 5 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 9c5272c2d..4f2350915 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -243,7 +243,7 @@ impl Body { | |||
243 | } | 243 | } |
244 | }; | 244 | }; |
245 | let expander = Expander::new(db, file_id, module); | 245 | let expander = Expander::new(db, file_id, module); |
246 | let (body, source_map) = Body::new(db, file_id, def, expander, params, body); | 246 | let (body, source_map) = Body::new(db, def, expander, params, body); |
247 | (Arc::new(body), Arc::new(source_map)) | 247 | (Arc::new(body), Arc::new(source_map)) |
248 | } | 248 | } |
249 | 249 | ||
@@ -253,13 +253,12 @@ impl Body { | |||
253 | 253 | ||
254 | fn new( | 254 | fn new( |
255 | db: &dyn DefDatabase, | 255 | db: &dyn DefDatabase, |
256 | file_id: HirFileId, | ||
257 | def: DefWithBodyId, | 256 | def: DefWithBodyId, |
258 | expander: Expander, | 257 | expander: Expander, |
259 | params: Option<ast::ParamList>, | 258 | params: Option<ast::ParamList>, |
260 | body: Option<ast::Expr>, | 259 | body: Option<ast::Expr>, |
261 | ) -> (Body, BodySourceMap) { | 260 | ) -> (Body, BodySourceMap) { |
262 | lower::lower(db, file_id, def, expander, params, body) | 261 | lower::lower(db, def, expander, params, body) |
263 | } | 262 | } |
264 | } | 263 | } |
265 | 264 | ||
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index a74136b8e..852d5cda7 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -57,17 +57,15 @@ impl LowerCtx { | |||
57 | 57 | ||
58 | pub(super) fn lower( | 58 | pub(super) fn lower( |
59 | db: &dyn DefDatabase, | 59 | db: &dyn DefDatabase, |
60 | file_id: HirFileId, | ||
61 | def: DefWithBodyId, | 60 | def: DefWithBodyId, |
62 | expander: Expander, | 61 | expander: Expander, |
63 | params: Option<ast::ParamList>, | 62 | params: Option<ast::ParamList>, |
64 | body: Option<ast::Expr>, | 63 | body: Option<ast::Expr>, |
65 | ) -> (Body, BodySourceMap) { | 64 | ) -> (Body, BodySourceMap) { |
66 | let item_tree = db.item_tree(file_id); | 65 | let item_tree = db.item_tree(expander.current_file_id); |
67 | ExprCollector { | 66 | ExprCollector { |
68 | db, | 67 | db, |
69 | def, | 68 | def, |
70 | expander, | ||
71 | source_map: BodySourceMap::default(), | 69 | source_map: BodySourceMap::default(), |
72 | body: Body { | 70 | body: Body { |
73 | exprs: Arena::default(), | 71 | exprs: Arena::default(), |
@@ -76,7 +74,8 @@ pub(super) fn lower( | |||
76 | body_expr: dummy_expr_id(), | 74 | body_expr: dummy_expr_id(), |
77 | item_scope: Default::default(), | 75 | item_scope: Default::default(), |
78 | }, | 76 | }, |
79 | item_trees: vec![(file_id, item_tree)], | 77 | item_trees: vec![(expander.current_file_id, item_tree)], |
78 | expander, | ||
80 | } | 79 | } |
81 | .collect(params, body) | 80 | .collect(params, body) |
82 | } | 81 | } |