aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/intern.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/hir_def/src/intern.rs b/crates/hir_def/src/intern.rs
index 2467e9299..0d5419be5 100644
--- a/crates/hir_def/src/intern.rs
+++ b/crates/hir_def/src/intern.rs
@@ -185,7 +185,10 @@ pub trait Internable: Hash + Eq + 'static {
185 fn storage() -> &'static InternStorage<Self>; 185 fn storage() -> &'static InternStorage<Self>;
186} 186}
187 187
188macro_rules! impl_internable { 188/// Implements `Internable` for a given list of types, making them usable with `Interned`.
189#[macro_export]
190#[doc(hidden)]
191macro_rules! _impl_internable {
189 ( $($t:path),+ $(,)? ) => { $( 192 ( $($t:path),+ $(,)? ) => { $(
190 impl Internable for $t { 193 impl Internable for $t {
191 fn storage() -> &'static InternStorage<Self> { 194 fn storage() -> &'static InternStorage<Self> {
@@ -196,10 +199,12 @@ macro_rules! impl_internable {
196 )+ }; 199 )+ };
197} 200}
198 201
202pub use crate::_impl_internable as impl_internable;
203
199impl_internable!( 204impl_internable!(
200 crate::type_ref::TypeRef, 205 crate::type_ref::TypeRef,
201 crate::type_ref::TraitRef, 206 crate::type_ref::TraitRef,
202 crate::path::ModPath, 207 crate::path::ModPath,
203 GenericParams, 208 GenericParams,
204 str 209 str,
205); 210);