move ids to HIR

This commit is contained in:
Aleksey Kladov 2018-11-28 03:31:50 +03:00
parent 11168c464c
commit f66e5b6e6b
10 changed files with 71 additions and 80 deletions

View file

@ -38,6 +38,20 @@ pub use crate::{
loc2id::{LocationIntener, NumericId},
};
#[macro_export]
macro_rules! impl_numeric_id {
($id:ident) => {
impl $crate::NumericId for $id {
fn from_u32(id: u32) -> Self {
$id(id)
}
fn to_u32(self) -> u32 {
self.0
}
}
};
}
pub trait BaseDatabase: salsa::Database {
fn check_canceled(&self) -> Cancelable<()> {
if self.salsa_runtime().is_current_revision_canceled() {