aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-19 17:47:43 +0000
committerGitHub <[email protected]>2020-03-19 17:47:43 +0000
commit1ba03c6995015b3143a417ed07437f0c9028a97d (patch)
treece3eb047dd9fe9005750a3b1417d95b1aa8fe01e /crates/ra_hir_def/src/nameres.rs
parent988f1dda6bde576ec2457dd97a7525014609c771 (diff)
parentf840fcb2f525c13809d6a736e434155edf075a06 (diff)
Merge #3656
3656: Simplify arenas r=matklad a=matklad At the moment, Arena is paranetrized by two types: index and data. The original motivation was to allow index to be defined in the downstream crate, so that you can add inherent impls to the index. However, it seems like we've never actually used that capability, so perhaps we should switch to a generic Index impl? This PR tries this out, switching only `raw.rs` and parts of `hir_def`. wdyt? Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres.rs')
-rw-r--r--crates/ra_hir_def/src/nameres.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs
index be53313ee..40bdc34f5 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_hir_def/src/nameres.rs
@@ -77,7 +77,7 @@ use crate::{
77#[derive(Debug, PartialEq, Eq)] 77#[derive(Debug, PartialEq, Eq)]
78pub struct CrateDefMap { 78pub struct CrateDefMap {
79 pub root: LocalModuleId, 79 pub root: LocalModuleId,
80 pub modules: Arena<LocalModuleId, ModuleData>, 80 pub modules: Arena<ModuleData>,
81 pub(crate) krate: CrateId, 81 pub(crate) krate: CrateId,
82 /// The prelude module for this crate. This either comes from an import 82 /// The prelude module for this crate. This either comes from an import
83 /// marked with the `prelude_import` attribute, or (in the normal case) from 83 /// marked with the `prelude_import` attribute, or (in the normal case) from
@@ -187,7 +187,7 @@ impl CrateDefMap {
187 }); 187 });
188 let def_map = { 188 let def_map = {
189 let edition = db.crate_graph()[krate].edition; 189 let edition = db.crate_graph()[krate].edition;
190 let mut modules: Arena<LocalModuleId, ModuleData> = Arena::default(); 190 let mut modules: Arena<ModuleData> = Arena::default();
191 let root = modules.alloc(ModuleData::default()); 191 let root = modules.alloc(ModuleData::default());
192 CrateDefMap { 192 CrateDefMap {
193 krate, 193 krate,