about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2021-11-16 12:15:47 +0100
committerLukas Wirth <lukastw97@gmail.com>2021-11-16 12:15:47 +0100
commit92f7db447ca76b10f53fd0434c77b6350cd0d606 (patch)
tree8a58d2d3f9827d33697524346a168f5dcc627554
parentd2513deb62989ab6fa33bcf8747ac2dfa36ffdfa (diff)
downloadrust-92f7db447ca76b10f53fd0434c77b6350cd0d606.tar.gz
rust-92f7db447ca76b10f53fd0434c77b6350cd0d606.zip
minor: Lift out FxIndex{Map/Set} types into ide_db
-rw-r--r--Cargo.lock3
-rw-r--r--crates/hir_def/Cargo.toml2
-rw-r--r--crates/ide/Cargo.toml1
-rw-r--r--crates/ide/src/call_hierarchy.rs6
-rw-r--r--crates/ide_assists/Cargo.toml1
-rw-r--r--crates/ide_assists/src/handlers/extract_function.rs7
-rw-r--r--crates/ide_db/Cargo.toml1
-rw-r--r--crates/ide_db/src/lib.rs4
-rw-r--r--crates/syntax/Cargo.toml2
-rw-r--r--crates/vfs/Cargo.toml2
10 files changed, 13 insertions, 16 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ba355216a8a..5a62bccf6b2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -585,7 +585,6 @@ dependencies = [
  "ide_db",
  "ide_diagnostics",
  "ide_ssr",
- "indexmap",
  "itertools",
  "oorandom",
  "profile",
@@ -609,7 +608,6 @@ dependencies = [
  "expect-test",
  "hir",
  "ide_db",
- "indexmap",
  "itertools",
  "profile",
  "rustc-hash",
@@ -654,6 +652,7 @@ dependencies = [
  "expect-test",
  "fst",
  "hir",
+ "indexmap",
  "itertools",
  "limit",
  "once_cell",
diff --git a/crates/hir_def/Cargo.toml b/crates/hir_def/Cargo.toml
index 3261577df05..8672ce6615c 100644
--- a/crates/hir_def/Cargo.toml
+++ b/crates/hir_def/Cargo.toml
@@ -20,7 +20,7 @@ anymap = "0.12.1"
 drop_bomb = "0.1.4"
 fst = { version = "0.4", default-features = false }
 itertools = "0.10.0"
-indexmap = "1.4.0"
+indexmap = "1.7.0"
 smallvec = "1.4.0"
 la-arena = { version = "0.3.0", path = "../../lib/arena" }
 
diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml
index aef8e367f20..3403b5a6311 100644
--- a/crates/ide/Cargo.toml
+++ b/crates/ide/Cargo.toml
@@ -12,7 +12,6 @@ doctest = false
 [dependencies]
 cov-mark = "2.0.0-pre.1"
 either = "1.5.3"
-indexmap = "1.4.0"
 itertools = "0.10.0"
 tracing = "0.1"
 rustc-hash = "1.1.0"
diff --git a/crates/ide/src/call_hierarchy.rs b/crates/ide/src/call_hierarchy.rs
index 23bffd56489..30614a9b494 100644
--- a/crates/ide/src/call_hierarchy.rs
+++ b/crates/ide/src/call_hierarchy.rs
@@ -1,13 +1,11 @@
 //! Entry point for call-hierarchy
 
-use indexmap::IndexMap;
-
 use hir::Semantics;
 use ide_db::{
     defs::{Definition, NameClass, NameRefClass},
     helpers::pick_best_token,
     search::FileReference,
-    RootDatabase,
+    FxIndexMap, RootDatabase,
 };
 use syntax::{ast, AstNode, SyntaxKind::NAME, TextRange};
 
@@ -125,7 +123,7 @@ pub(crate) fn outgoing_calls(db: &RootDatabase, position: FilePosition) -> Optio
 
 #[derive(Default)]
 struct CallLocations {
-    funcs: IndexMap<NavigationTarget, Vec<TextRange>>,
+    funcs: FxIndexMap<NavigationTarget, Vec<TextRange>>,
 }
 
 impl CallLocations {
diff --git a/crates/ide_assists/Cargo.toml b/crates/ide_assists/Cargo.toml
index de5dd6cb79f..4d97e9150eb 100644
--- a/crates/ide_assists/Cargo.toml
+++ b/crates/ide_assists/Cargo.toml
@@ -14,7 +14,6 @@ cov-mark = "2.0.0-pre.1"
 rustc-hash = "1.1.0"
 itertools = "0.10.0"
 either = "1.6.1"
-indexmap = "1.6.2"
 
 stdx = { path = "../stdx", version = "0.0.0" }
 syntax = { path = "../syntax", version = "0.0.0" }
diff --git a/crates/ide_assists/src/handlers/extract_function.rs b/crates/ide_assists/src/handlers/extract_function.rs
index 3a334efe0ab..e2845bc58b6 100644
--- a/crates/ide_assists/src/handlers/extract_function.rs
+++ b/crates/ide_assists/src/handlers/extract_function.rs
@@ -1,4 +1,4 @@
-use std::{hash::BuildHasherDefault, iter};
+use std::iter;
 
 use ast::make;
 use either::Either;
@@ -12,10 +12,9 @@ use ide_db::{
         FamousDefs,
     },
     search::{FileReference, ReferenceCategory, SearchScope},
-    RootDatabase,
+    FxIndexSet, RootDatabase,
 };
 use itertools::Itertools;
-use rustc_hash::FxHasher;
 use stdx::format_to;
 use syntax::{
     ast::{
@@ -33,8 +32,6 @@ use crate::{
     AssistId,
 };
 
-type FxIndexSet<T> = indexmap::IndexSet<T, BuildHasherDefault<FxHasher>>;
-
 // Assist: extract_function
 //
 // Extracts selected statements into new function.
diff --git a/crates/ide_db/Cargo.toml b/crates/ide_db/Cargo.toml
index d6586185c54..ea20f5372c9 100644
--- a/crates/ide_db/Cargo.toml
+++ b/crates/ide_db/Cargo.toml
@@ -19,6 +19,7 @@ once_cell = "1.3.1"
 either = "1.6.1"
 itertools = "0.10.0"
 arrayvec = "0.7"
+indexmap = "1.7"
 
 stdx = { path = "../stdx", version = "0.0.0" }
 syntax = { path = "../syntax", version = "0.0.0" }
diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs
index eaa9291fce4..77db09315d9 100644
--- a/crates/ide_db/src/lib.rs
+++ b/crates/ide_db/src/lib.rs
@@ -34,6 +34,10 @@ use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
 /// `base_db` is normally also needed in places where `ide_db` is used, so this re-export is for convenience.
 pub use base_db;
 
+pub type FxIndexSet<T> = indexmap::IndexSet<T, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
+pub type FxIndexMap<K, V> =
+    indexmap::IndexMap<K, V, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
+
 #[salsa::database(
     base_db::SourceDatabaseStorage,
     base_db::SourceDatabaseExtStorage,
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml
index c3d08acb271..8705fb21150 100644
--- a/crates/syntax/Cargo.toml
+++ b/crates/syntax/Cargo.toml
@@ -17,7 +17,7 @@ rowan = "0.14.0"
 rustc_lexer = { version = "725.0.0", package = "rustc-ap-rustc_lexer" }
 rustc-hash = "1.1.0"
 once_cell = "1.3.1"
-indexmap = "1.4.0"
+indexmap = "1.7.0"
 smol_str = "0.1.21"
 
 stdx = { path = "../stdx", version = "0.0.0" }
diff --git a/crates/vfs/Cargo.toml b/crates/vfs/Cargo.toml
index f77e56f13ed..2c62626b750 100644
--- a/crates/vfs/Cargo.toml
+++ b/crates/vfs/Cargo.toml
@@ -14,4 +14,4 @@ rustc-hash = "1.0"
 fst = "0.4"
 
 paths = { path = "../paths", version = "0.0.0" }
-indexmap = "1.6.2"
+indexmap = "1.7"