aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_db/src/lib.rs2
-rw-r--r--crates/ra_db/src/loc2id.rs10
-rw-r--r--crates/ra_hir/src/ids.rs34
3 files changed, 23 insertions, 23 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index e006c6d27..f3389c91f 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -16,7 +16,7 @@ pub use crate::{
16 input::{ 16 input::{
17 FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, Dependency, Edition, 17 FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, Dependency, Edition,
18 }, 18 },
19 loc2id::LocationIntener, 19 loc2id::LocationInterner,
20}; 20};
21 21
22pub trait CheckCanceled: panic::RefUnwindSafe { 22pub trait CheckCanceled: panic::RefUnwindSafe {
diff --git a/crates/ra_db/src/loc2id.rs b/crates/ra_db/src/loc2id.rs
index d27fa7682..eae64a4eb 100644
--- a/crates/ra_db/src/loc2id.rs
+++ b/crates/ra_db/src/loc2id.rs
@@ -59,7 +59,7 @@ where
59} 59}
60 60
61#[derive(Debug)] 61#[derive(Debug)]
62pub struct LocationIntener<LOC, ID> 62pub struct LocationInterner<LOC, ID>
63where 63where
64 ID: ArenaId + Clone, 64 ID: ArenaId + Clone,
65 LOC: Clone + Eq + Hash, 65 LOC: Clone + Eq + Hash,
@@ -67,7 +67,7 @@ where
67 map: Mutex<Loc2IdMap<LOC, ID>>, 67 map: Mutex<Loc2IdMap<LOC, ID>>,
68} 68}
69 69
70impl<LOC, ID> panic::RefUnwindSafe for LocationIntener<LOC, ID> 70impl<LOC, ID> panic::RefUnwindSafe for LocationInterner<LOC, ID>
71where 71where
72 ID: ArenaId + Clone, 72 ID: ArenaId + Clone,
73 LOC: Clone + Eq + Hash, 73 LOC: Clone + Eq + Hash,
@@ -76,17 +76,17 @@ where
76{ 76{
77} 77}
78 78
79impl<LOC, ID> Default for LocationIntener<LOC, ID> 79impl<LOC, ID> Default for LocationInterner<LOC, ID>
80where 80where
81 ID: ArenaId + Clone, 81 ID: ArenaId + Clone,
82 LOC: Clone + Eq + Hash, 82 LOC: Clone + Eq + Hash,
83{ 83{
84 fn default() -> Self { 84 fn default() -> Self {
85 LocationIntener { map: Default::default() } 85 LocationInterner { map: Default::default() }
86 } 86 }
87} 87}
88 88
89impl<LOC, ID> LocationIntener<LOC, ID> 89impl<LOC, ID> LocationInterner<LOC, ID>
90where 90where
91 ID: ArenaId + Clone, 91 ID: ArenaId + Clone,
92 LOC: Clone + Eq + Hash, 92 LOC: Clone + Eq + Hash,
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs
index 9596488d3..3d0a881c2 100644
--- a/crates/ra_hir/src/ids.rs
+++ b/crates/ra_hir/src/ids.rs
@@ -4,7 +4,7 @@ use std::{
4 sync::Arc, 4 sync::Arc,
5}; 5};
6 6
7use ra_db::{LocationIntener, FileId}; 7use ra_db::{LocationInterner, FileId};
8use ra_syntax::{TreeArc, SyntaxNode, SourceFile, AstNode, SyntaxNodePtr, ast}; 8use ra_syntax::{TreeArc, SyntaxNode, SourceFile, AstNode, SyntaxNodePtr, ast};
9use ra_arena::{Arena, RawId, ArenaId, impl_arena_id}; 9use ra_arena::{Arena, RawId, ArenaId, impl_arena_id};
10 10
@@ -15,14 +15,14 @@ use crate::{
15 15
16#[derive(Debug, Default)] 16#[derive(Debug, Default)]
17pub struct HirInterner { 17pub struct HirInterner {
18 macros: LocationIntener<MacroCallLoc, MacroCallId>, 18 macros: LocationInterner<MacroCallLoc, MacroCallId>,
19 fns: LocationIntener<ItemLoc<ast::FnDef>, FunctionId>, 19 fns: LocationInterner<ItemLoc<ast::FnDef>, FunctionId>,
20 structs: LocationIntener<ItemLoc<ast::StructDef>, StructId>, 20 structs: LocationInterner<ItemLoc<ast::StructDef>, StructId>,
21 enums: LocationIntener<ItemLoc<ast::EnumDef>, EnumId>, 21 enums: LocationInterner<ItemLoc<ast::EnumDef>, EnumId>,
22 consts: LocationIntener<ItemLoc<ast::ConstDef>, ConstId>, 22 consts: LocationInterner<ItemLoc<ast::ConstDef>, ConstId>,
23 statics: LocationIntener<ItemLoc<ast::StaticDef>, StaticId>, 23 statics: LocationInterner<ItemLoc<ast::StaticDef>, StaticId>,
24 traits: LocationIntener<ItemLoc<ast::TraitDef>, TraitId>, 24 traits: LocationInterner<ItemLoc<ast::TraitDef>, TraitId>,
25 types: LocationIntener<ItemLoc<ast::TypeAliasDef>, TypeId>, 25 types: LocationInterner<ItemLoc<ast::TypeAliasDef>, TypeId>,
26} 26}
27 27
28impl HirInterner { 28impl HirInterner {
@@ -204,7 +204,7 @@ impl<'a, DB: PersistentHirDatabase> LocationCtx<&'a DB> {
204} 204}
205 205
206pub(crate) trait AstItemDef<N: AstNode>: ArenaId + Clone { 206pub(crate) trait AstItemDef<N: AstNode>: ArenaId + Clone {
207 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<N>, Self>; 207 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<N>, Self>;
208 fn from_ast(ctx: LocationCtx<&impl PersistentHirDatabase>, ast: &N) -> Self { 208 fn from_ast(ctx: LocationCtx<&impl PersistentHirDatabase>, ast: &N) -> Self {
209 let items = ctx.db.file_items(ctx.file_id); 209 let items = ctx.db.file_items(ctx.file_id);
210 let item_id = items.id_of(ctx.file_id, ast.syntax()); 210 let item_id = items.id_of(ctx.file_id, ast.syntax());
@@ -238,7 +238,7 @@ pub(crate) trait AstItemDef<N: AstNode>: ArenaId + Clone {
238pub struct FunctionId(RawId); 238pub struct FunctionId(RawId);
239impl_arena_id!(FunctionId); 239impl_arena_id!(FunctionId);
240impl AstItemDef<ast::FnDef> for FunctionId { 240impl AstItemDef<ast::FnDef> for FunctionId {
241 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::FnDef>, Self> { 241 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::FnDef>, Self> {
242 &interner.fns 242 &interner.fns
243 } 243 }
244} 244}
@@ -247,7 +247,7 @@ impl AstItemDef<ast::FnDef> for FunctionId {
247pub struct StructId(RawId); 247pub struct StructId(RawId);
248impl_arena_id!(StructId); 248impl_arena_id!(StructId);
249impl AstItemDef<ast::StructDef> for StructId { 249impl AstItemDef<ast::StructDef> for StructId {
250 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::StructDef>, Self> { 250 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::StructDef>, Self> {
251 &interner.structs 251 &interner.structs
252 } 252 }
253} 253}
@@ -256,7 +256,7 @@ impl AstItemDef<ast::StructDef> for StructId {
256pub struct EnumId(RawId); 256pub struct EnumId(RawId);
257impl_arena_id!(EnumId); 257impl_arena_id!(EnumId);
258impl AstItemDef<ast::EnumDef> for EnumId { 258impl AstItemDef<ast::EnumDef> for EnumId {
259 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::EnumDef>, Self> { 259 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::EnumDef>, Self> {
260 &interner.enums 260 &interner.enums
261 } 261 }
262} 262}
@@ -265,7 +265,7 @@ impl AstItemDef<ast::EnumDef> for EnumId {
265pub struct ConstId(RawId); 265pub struct ConstId(RawId);
266impl_arena_id!(ConstId); 266impl_arena_id!(ConstId);
267impl AstItemDef<ast::ConstDef> for ConstId { 267impl AstItemDef<ast::ConstDef> for ConstId {
268 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::ConstDef>, Self> { 268 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::ConstDef>, Self> {
269 &interner.consts 269 &interner.consts
270 } 270 }
271} 271}
@@ -274,7 +274,7 @@ impl AstItemDef<ast::ConstDef> for ConstId {
274pub struct StaticId(RawId); 274pub struct StaticId(RawId);
275impl_arena_id!(StaticId); 275impl_arena_id!(StaticId);
276impl AstItemDef<ast::StaticDef> for StaticId { 276impl AstItemDef<ast::StaticDef> for StaticId {
277 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::StaticDef>, Self> { 277 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::StaticDef>, Self> {
278 &interner.statics 278 &interner.statics
279 } 279 }
280} 280}
@@ -283,7 +283,7 @@ impl AstItemDef<ast::StaticDef> for StaticId {
283pub struct TraitId(RawId); 283pub struct TraitId(RawId);
284impl_arena_id!(TraitId); 284impl_arena_id!(TraitId);
285impl AstItemDef<ast::TraitDef> for TraitId { 285impl AstItemDef<ast::TraitDef> for TraitId {
286 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::TraitDef>, Self> { 286 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::TraitDef>, Self> {
287 &interner.traits 287 &interner.traits
288 } 288 }
289} 289}
@@ -292,7 +292,7 @@ impl AstItemDef<ast::TraitDef> for TraitId {
292pub struct TypeId(RawId); 292pub struct TypeId(RawId);
293impl_arena_id!(TypeId); 293impl_arena_id!(TypeId);
294impl AstItemDef<ast::TypeAliasDef> for TypeId { 294impl AstItemDef<ast::TypeAliasDef> for TypeId {
295 fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::TypeAliasDef>, Self> { 295 fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::TypeAliasDef>, Self> {
296 &interner.types 296 &interner.types
297 } 297 }
298} 298}