mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Pull macro up
This commit is contained in:
parent
f11237561c
commit
53506a7552
3 changed files with 16 additions and 28 deletions
|
@ -15,6 +15,20 @@ pub use crate::{
|
|||
pub use relative_path::{RelativePath, RelativePathBuf};
|
||||
pub use salsa;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! impl_intern_key {
|
||||
($name:ident) => {
|
||||
impl $crate::salsa::InternKey for $name {
|
||||
fn from_intern_id(v: $crate::salsa::InternId) -> Self {
|
||||
$name(v)
|
||||
}
|
||||
fn as_intern_id(&self) -> $crate::salsa::InternId {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
pub trait CheckCanceled {
|
||||
/// Aborts current query if there are pending changes.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue