From 59d4640b644fa12ecc8f5075d92e5c53124e5dd7 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 24 Jun 2020 16:21:00 +0200 Subject: Remove unneeded HirFileId argument --- crates/ra_hir_def/src/body.rs | 5 ++--- crates/ra_hir_def/src/body/lower.rs | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir_def/src') 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 { } }; let expander = Expander::new(db, file_id, module); - let (body, source_map) = Body::new(db, file_id, def, expander, params, body); + let (body, source_map) = Body::new(db, def, expander, params, body); (Arc::new(body), Arc::new(source_map)) } @@ -253,13 +253,12 @@ impl Body { fn new( db: &dyn DefDatabase, - file_id: HirFileId, def: DefWithBodyId, expander: Expander, params: Option, body: Option, ) -> (Body, BodySourceMap) { - lower::lower(db, file_id, def, expander, params, body) + lower::lower(db, def, expander, params, body) } } 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 { pub(super) fn lower( db: &dyn DefDatabase, - file_id: HirFileId, def: DefWithBodyId, expander: Expander, params: Option, body: Option, ) -> (Body, BodySourceMap) { - let item_tree = db.item_tree(file_id); + let item_tree = db.item_tree(expander.current_file_id); ExprCollector { db, def, - expander, source_map: BodySourceMap::default(), body: Body { exprs: Arena::default(), @@ -76,7 +74,8 @@ pub(super) fn lower( body_expr: dummy_expr_id(), item_scope: Default::default(), }, - item_trees: vec![(file_id, item_tree)], + item_trees: vec![(expander.current_file_id, item_tree)], + expander, } .collect(params, body) } -- cgit v1.2.3