Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/hir/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::{
};

define_enum_deriving_from! {
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub enum ContainerId {
HirFileId(HirFileId),
ModuleId(ModuleId),
Expand All @@ -40,7 +40,7 @@ define_enum_deriving_from! {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub struct InContainer<T> {
pub value: T,
pub cont_id: ContainerId,
Expand All @@ -60,7 +60,7 @@ impl<T> InContainer<T> {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub struct InSubroutine<T> {
pub value: T,
pub subroutine: SubroutineId,
Expand All @@ -85,7 +85,7 @@ impl<T> From<InSubroutine<T>> for InContainer<T> {
macro_rules! define_container_id {
($($name:ident[$id:ident : $ty:ty]),* $(,)?) => {
$(
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub struct $name<T> {
pub value: T,
pub $id: $ty,
Expand Down
5 changes: 5 additions & 0 deletions crates/hir/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use triomphe::Arc;

use crate::{
base_db::{salsa, source_db::SourceRootDb},
def_id::{ModuleDef, ModuleDefId},
file::HirFileId,
hir_def::{
block::{self, Block, BlockId, BlockLoc, BlockSourceMap},
Expand Down Expand Up @@ -45,6 +46,9 @@ pub trait InternDb: SourceRootDb {

#[salsa::interned]
fn intern_macro_file(&self, macro_file: MacroFileLoc) -> MacroFileId;

#[salsa::interned]
fn intern_module_def(&self, module_def: ModuleDef) -> ModuleDefId;
}

impl_intern!(BuiltinDataTyId, BuiltinDataTy, intern_ty, lookup_intern_ty);
Expand All @@ -58,6 +62,7 @@ impl_intern!(
);
impl_intern!(MacroCallId, MacroCallLoc, intern_macro_call, lookup_intern_macro_call);
impl_intern!(MacroFileId, MacroFileLoc, intern_macro_file, lookup_intern_macro_file);
impl_intern!(ModuleDefId, ModuleDef, intern_module_def, lookup_intern_module_def);

#[salsa::query_group(HirDbStorage)]
pub trait HirDb: InternDb {
Expand Down
Loading
Loading