summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/intern
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/rust-analyzer/crates/intern/Cargo.toml20
-rw-r--r--src/tools/rust-analyzer/crates/intern/src/lib.rs (renamed from src/tools/rust-analyzer/crates/hir-def/src/intern.rs)19
2 files changed, 24 insertions, 15 deletions
diff --git a/src/tools/rust-analyzer/crates/intern/Cargo.toml b/src/tools/rust-analyzer/crates/intern/Cargo.toml
new file mode 100644
index 000000000..c73c368a1
--- /dev/null
+++ b/src/tools/rust-analyzer/crates/intern/Cargo.toml
@@ -0,0 +1,20 @@
+[package]
+name = "intern"
+version = "0.0.0"
+description = "TBD"
+
+authors.workspace = true
+edition.workspace = true
+license.workspace = true
+rust-version.workspace = true
+
+[lib]
+doctest = false
+
+
+[dependencies]
+# We need to freeze the version of the crate, as the raw-api feature is considered unstable
+dashmap = { version = "=5.4.0", features = ["raw-api"] }
+hashbrown = { version = "0.12.1", default-features = false }
+once_cell = "1.17.0"
+rustc-hash = "1.1.0"
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/intern.rs b/src/tools/rust-analyzer/crates/intern/src/lib.rs
index f08521a34..fb2903696 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/intern.rs
+++ b/src/tools/rust-analyzer/crates/intern/src/lib.rs
@@ -14,8 +14,6 @@ use hashbrown::HashMap;
use once_cell::sync::OnceCell;
use rustc_hash::FxHasher;
-use crate::generics::GenericParams;
-
type InternMap<T> = DashMap<Arc<T>, (), BuildHasherDefault<FxHasher>>;
type Guard<T> = dashmap::RwLockWriteGuard<
'static,
@@ -204,9 +202,9 @@ pub trait Internable: Hash + Eq + 'static {
#[doc(hidden)]
macro_rules! _impl_internable {
( $($t:path),+ $(,)? ) => { $(
- impl Internable for $t {
- fn storage() -> &'static InternStorage<Self> {
- static STORAGE: InternStorage<$t> = InternStorage::new();
+ impl $crate::Internable for $t {
+ fn storage() -> &'static $crate::InternStorage<Self> {
+ static STORAGE: $crate::InternStorage<$t> = $crate::InternStorage::new();
&STORAGE
}
}
@@ -215,13 +213,4 @@ macro_rules! _impl_internable {
pub use crate::_impl_internable as impl_internable;
-impl_internable!(
- crate::type_ref::TypeRef,
- crate::type_ref::TraitRef,
- crate::type_ref::TypeBound,
- crate::path::ModPath,
- crate::path::GenericArgs,
- crate::attr::AttrInput,
- GenericParams,
- str,
-);
+impl_internable!(str,);