mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
ra_hir_expand: migrate to impl_intern_key!()
This commit is contained in:
parent
af8097f777
commit
cbd9f46bc7
1 changed files with 3 additions and 17 deletions
|
@ -17,7 +17,7 @@ pub mod eager;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use ra_db::{salsa, CrateId, FileId};
|
use ra_db::{salsa, CrateId, FileId, impl_intern_key};
|
||||||
use ra_syntax::{
|
use ra_syntax::{
|
||||||
algo,
|
algo,
|
||||||
ast::{self, AstNode},
|
ast::{self, AstNode},
|
||||||
|
@ -174,25 +174,11 @@ pub enum MacroCallId {
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub struct LazyMacroId(salsa::InternId);
|
pub struct LazyMacroId(salsa::InternId);
|
||||||
impl salsa::InternKey for LazyMacroId {
|
impl_intern_key!(LazyMacroId);
|
||||||
fn from_intern_id(v: salsa::InternId) -> Self {
|
|
||||||
LazyMacroId(v)
|
|
||||||
}
|
|
||||||
fn as_intern_id(&self) -> salsa::InternId {
|
|
||||||
self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub struct EagerMacroId(salsa::InternId);
|
pub struct EagerMacroId(salsa::InternId);
|
||||||
impl salsa::InternKey for EagerMacroId {
|
impl_intern_key!(EagerMacroId);
|
||||||
fn from_intern_id(v: salsa::InternId) -> Self {
|
|
||||||
EagerMacroId(v)
|
|
||||||
}
|
|
||||||
fn as_intern_id(&self) -> salsa::InternId {
|
|
||||||
self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<LazyMacroId> for MacroCallId {
|
impl From<LazyMacroId> for MacroCallId {
|
||||||
fn from(it: LazyMacroId) -> Self {
|
fn from(it: LazyMacroId) -> Self {
|
||||||
|
|
Loading…
Reference in a new issue