Fixed typo in Interner’s name (Intener)

This commit is contained in:
Vincent Esche 2019-03-20 09:29:10 +01:00
parent d080c8f021
commit 21f20d5deb
3 changed files with 23 additions and 23 deletions

View file

@ -16,7 +16,7 @@ pub use crate::{
input::{ input::{
FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, Dependency, Edition, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, Dependency, Edition,
}, },
loc2id::LocationIntener, loc2id::LocationInterner,
}; };
pub trait CheckCanceled: panic::RefUnwindSafe { pub trait CheckCanceled: panic::RefUnwindSafe {

View file

@ -59,7 +59,7 @@ where
} }
#[derive(Debug)] #[derive(Debug)]
pub struct LocationIntener<LOC, ID> pub struct LocationInterner<LOC, ID>
where where
ID: ArenaId + Clone, ID: ArenaId + Clone,
LOC: Clone + Eq + Hash, LOC: Clone + Eq + Hash,
@ -67,7 +67,7 @@ where
map: Mutex<Loc2IdMap<LOC, ID>>, map: Mutex<Loc2IdMap<LOC, ID>>,
} }
impl<LOC, ID> panic::RefUnwindSafe for LocationIntener<LOC, ID> impl<LOC, ID> panic::RefUnwindSafe for LocationInterner<LOC, ID>
where where
ID: ArenaId + Clone, ID: ArenaId + Clone,
LOC: Clone + Eq + Hash, LOC: Clone + Eq + Hash,
@ -76,17 +76,17 @@ where
{ {
} }
impl<LOC, ID> Default for LocationIntener<LOC, ID> impl<LOC, ID> Default for LocationInterner<LOC, ID>
where where
ID: ArenaId + Clone, ID: ArenaId + Clone,
LOC: Clone + Eq + Hash, LOC: Clone + Eq + Hash,
{ {
fn default() -> Self { fn default() -> Self {
LocationIntener { map: Default::default() } LocationInterner { map: Default::default() }
} }
} }
impl<LOC, ID> LocationIntener<LOC, ID> impl<LOC, ID> LocationInterner<LOC, ID>
where where
ID: ArenaId + Clone, ID: ArenaId + Clone,
LOC: Clone + Eq + Hash, LOC: Clone + Eq + Hash,

View file

@ -4,7 +4,7 @@ use std::{
sync::Arc, sync::Arc,
}; };
use ra_db::{LocationIntener, FileId}; use ra_db::{LocationInterner, FileId};
use ra_syntax::{TreeArc, SyntaxNode, SourceFile, AstNode, SyntaxNodePtr, ast}; use ra_syntax::{TreeArc, SyntaxNode, SourceFile, AstNode, SyntaxNodePtr, ast};
use ra_arena::{Arena, RawId, ArenaId, impl_arena_id}; use ra_arena::{Arena, RawId, ArenaId, impl_arena_id};
@ -15,14 +15,14 @@ use crate::{
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct HirInterner { pub struct HirInterner {
macros: LocationIntener<MacroCallLoc, MacroCallId>, macros: LocationInterner<MacroCallLoc, MacroCallId>,
fns: LocationIntener<ItemLoc<ast::FnDef>, FunctionId>, fns: LocationInterner<ItemLoc<ast::FnDef>, FunctionId>,
structs: LocationIntener<ItemLoc<ast::StructDef>, StructId>, structs: LocationInterner<ItemLoc<ast::StructDef>, StructId>,
enums: LocationIntener<ItemLoc<ast::EnumDef>, EnumId>, enums: LocationInterner<ItemLoc<ast::EnumDef>, EnumId>,
consts: LocationIntener<ItemLoc<ast::ConstDef>, ConstId>, consts: LocationInterner<ItemLoc<ast::ConstDef>, ConstId>,
statics: LocationIntener<ItemLoc<ast::StaticDef>, StaticId>, statics: LocationInterner<ItemLoc<ast::StaticDef>, StaticId>,
traits: LocationIntener<ItemLoc<ast::TraitDef>, TraitId>, traits: LocationInterner<ItemLoc<ast::TraitDef>, TraitId>,
types: LocationIntener<ItemLoc<ast::TypeAliasDef>, TypeId>, types: LocationInterner<ItemLoc<ast::TypeAliasDef>, TypeId>,
} }
impl HirInterner { impl HirInterner {
@ -204,7 +204,7 @@ impl<'a, DB: PersistentHirDatabase> LocationCtx<&'a DB> {
} }
pub(crate) trait AstItemDef<N: AstNode>: ArenaId + Clone { pub(crate) trait AstItemDef<N: AstNode>: ArenaId + Clone {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<N>, Self>; fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<N>, Self>;
fn from_ast(ctx: LocationCtx<&impl PersistentHirDatabase>, ast: &N) -> Self { fn from_ast(ctx: LocationCtx<&impl PersistentHirDatabase>, ast: &N) -> Self {
let items = ctx.db.file_items(ctx.file_id); let items = ctx.db.file_items(ctx.file_id);
let item_id = items.id_of(ctx.file_id, ast.syntax()); let item_id = items.id_of(ctx.file_id, ast.syntax());
@ -238,7 +238,7 @@ pub(crate) trait AstItemDef<N: AstNode>: ArenaId + Clone {
pub struct FunctionId(RawId); pub struct FunctionId(RawId);
impl_arena_id!(FunctionId); impl_arena_id!(FunctionId);
impl AstItemDef<ast::FnDef> for FunctionId { impl AstItemDef<ast::FnDef> for FunctionId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::FnDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::FnDef>, Self> {
&interner.fns &interner.fns
} }
} }
@ -247,7 +247,7 @@ impl AstItemDef<ast::FnDef> for FunctionId {
pub struct StructId(RawId); pub struct StructId(RawId);
impl_arena_id!(StructId); impl_arena_id!(StructId);
impl AstItemDef<ast::StructDef> for StructId { impl AstItemDef<ast::StructDef> for StructId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::StructDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::StructDef>, Self> {
&interner.structs &interner.structs
} }
} }
@ -256,7 +256,7 @@ impl AstItemDef<ast::StructDef> for StructId {
pub struct EnumId(RawId); pub struct EnumId(RawId);
impl_arena_id!(EnumId); impl_arena_id!(EnumId);
impl AstItemDef<ast::EnumDef> for EnumId { impl AstItemDef<ast::EnumDef> for EnumId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::EnumDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::EnumDef>, Self> {
&interner.enums &interner.enums
} }
} }
@ -265,7 +265,7 @@ impl AstItemDef<ast::EnumDef> for EnumId {
pub struct ConstId(RawId); pub struct ConstId(RawId);
impl_arena_id!(ConstId); impl_arena_id!(ConstId);
impl AstItemDef<ast::ConstDef> for ConstId { impl AstItemDef<ast::ConstDef> for ConstId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::ConstDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::ConstDef>, Self> {
&interner.consts &interner.consts
} }
} }
@ -274,7 +274,7 @@ impl AstItemDef<ast::ConstDef> for ConstId {
pub struct StaticId(RawId); pub struct StaticId(RawId);
impl_arena_id!(StaticId); impl_arena_id!(StaticId);
impl AstItemDef<ast::StaticDef> for StaticId { impl AstItemDef<ast::StaticDef> for StaticId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::StaticDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::StaticDef>, Self> {
&interner.statics &interner.statics
} }
} }
@ -283,7 +283,7 @@ impl AstItemDef<ast::StaticDef> for StaticId {
pub struct TraitId(RawId); pub struct TraitId(RawId);
impl_arena_id!(TraitId); impl_arena_id!(TraitId);
impl AstItemDef<ast::TraitDef> for TraitId { impl AstItemDef<ast::TraitDef> for TraitId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::TraitDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::TraitDef>, Self> {
&interner.traits &interner.traits
} }
} }
@ -292,7 +292,7 @@ impl AstItemDef<ast::TraitDef> for TraitId {
pub struct TypeId(RawId); pub struct TypeId(RawId);
impl_arena_id!(TypeId); impl_arena_id!(TypeId);
impl AstItemDef<ast::TypeAliasDef> for TypeId { impl AstItemDef<ast::TypeAliasDef> for TypeId {
fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::TypeAliasDef>, Self> { fn interner(interner: &HirInterner) -> &LocationInterner<ItemLoc<ast::TypeAliasDef>, Self> {
&interner.types &interner.types
} }
} }