aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-05 15:59:03 +0100
committerJonas Schievink <[email protected]>2021-04-05 15:59:13 +0100
commita0b50bcf1e18c5d909e8791e06284b9787076e8b (patch)
treea883911709c07fbcc0ab2ab6fc6c7334865d5ead
parentfab1c066464022613729a6d714dc83b7d698ece5 (diff)
Make `impl_internable!` macro public
-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);