aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-12 13:52:30 +0000
committerGitHub <[email protected]>2019-11-12 13:52:30 +0000
commit55f3ff241a2105d2903266703474acbd24a85e84 (patch)
treed953d49eac9da39748afabd512b5390875e18ba1 /crates/ra_hir/src/expr
parent6149ee30ef9a379f642c8a645cea13f32c4f3d84 (diff)
parentfe00db72b91d266a61b0541bca59e38e5f2a703c (diff)
Merge #2222
2222: Remove owner from Body r=matklad a=matklad cc @flodiebold I do this so that it's easier to move lowering code to another crate (owner is the only thing that tethers Body to the rest of the code), but it's interesting that this is a net reduction of lines. I think this might be considered an evidence that it's a good idea to not add "parent pointers" / parent ids to data structures, and instead add them to `ctx` objects which are used when building data structures bors r+ Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r--crates/ra_hir/src/expr/lower.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs
index 7b0bfd919..adc68b23c 100644
--- a/crates/ra_hir/src/expr/lower.rs
+++ b/crates/ra_hir/src/expr/lower.rs
@@ -20,8 +20,8 @@ use ra_syntax::{
20use test_utils::tested_by; 20use test_utils::tested_by;
21 21
22use crate::{ 22use crate::{
23 db::HirDatabase, AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, 23 db::HirDatabase, AstId, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path,
24 Mutability, Path, Resolver, Source, 24 Resolver, Source,
25}; 25};
26 26
27use super::{ 27use super::{
@@ -33,7 +33,6 @@ pub(super) fn lower(
33 db: &impl HirDatabase, 33 db: &impl HirDatabase,
34 resolver: Resolver, 34 resolver: Resolver,
35 file_id: HirFileId, 35 file_id: HirFileId,
36 owner: DefWithBody,
37 params: Option<ast::ParamList>, 36 params: Option<ast::ParamList>,
38 body: Option<ast::Expr>, 37 body: Option<ast::Expr>,
39) -> (Body, BodySourceMap) { 38) -> (Body, BodySourceMap) {
@@ -44,7 +43,6 @@ pub(super) fn lower(
44 current_file_id: file_id, 43 current_file_id: file_id,
45 source_map: BodySourceMap::default(), 44 source_map: BodySourceMap::default(),
46 body: Body { 45 body: Body {
47 owner,
48 exprs: Arena::default(), 46 exprs: Arena::default(),
49 pats: Arena::default(), 47 pats: Arena::default(),
50 params: Vec::new(), 48 params: Vec::new(),