mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
move ids to HIR
This commit is contained in:
parent
11168c464c
commit
f66e5b6e6b
10 changed files with 71 additions and 80 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue