Skip to content

Commit 1b12021

Browse files
committed
Auto merge of rust-lang#12078 - Veykril:neither, r=Veykril
minor: Re-export `FxHashMap` and `FxHashSet` from `ide_db`
2 parents 04000c3 + 4255996 commit 1b12021

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+70
-94
lines changed

Cargo.lock

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ide/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ crossbeam-channel = "0.5.4"
1515
either = "1.6.1"
1616
itertools = "0.10.3"
1717
tracing = "0.1.32"
18-
rustc-hash = "1.1.0"
1918
oorandom = "11.1.3"
2019
pulldown-cmark-to-cmark = "10.0.1"
2120
pulldown-cmark = { version = "0.9.1", default-features = false }

crates/ide/src/folding_ranges.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use ide_db::syntax_helpers::node_ext::vis_eq;
2-
use rustc_hash::FxHashSet;
3-
1+
use ide_db::{syntax_helpers::node_ext::vis_eq, FxHashSet};
42
use syntax::{
53
ast::{self, AstNode, AstToken},
64
match_ast, Direction, NodeOrToken, SourceFile,

crates/ide/src/highlight_related.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ use ide_db::{
55
helpers::pick_best_token,
66
search::{FileReference, ReferenceCategory, SearchScope},
77
syntax_helpers::node_ext::{for_each_break_and_continue_expr, for_each_tail_expr, walk_expr},
8-
RootDatabase,
8+
FxHashSet, RootDatabase,
99
};
10-
use rustc_hash::FxHashSet;
1110
use syntax::{
1211
ast::{self, HasLoopBody},
1312
match_ast, AstNode,

crates/ide/src/inlay_hints.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use either::Either;
22
use hir::{known, Callable, HasVisibility, HirDisplay, Semantics, TypeInfo};
33
use ide_db::{
4-
base_db::FileRange, famous_defs::FamousDefs, syntax_helpers::node_ext::walk_ty, RootDatabase,
4+
base_db::FileRange, famous_defs::FamousDefs, syntax_helpers::node_ext::walk_ty, FxHashMap,
5+
RootDatabase,
56
};
67
use itertools::Itertools;
7-
use rustc_hash::FxHashMap;
88
use stdx::to_lower_snake_case;
99
use syntax::{
1010
ast::{self, AstNode, HasArgList, HasGenericParams, HasName, UnaryOp},

crates/ide/src/prime_caches.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ use ide_db::{
1212
salsa::{Database, ParallelDatabase, Snapshot},
1313
Cancelled, CrateGraph, CrateId, SourceDatabase, SourceDatabaseExt,
1414
},
15-
FxIndexMap,
15+
FxHashSet, FxIndexMap,
1616
};
17-
use rustc_hash::FxHashSet;
1817

1918
use crate::RootDatabase;
2019

crates/ide/src/prime_caches/topologic_sort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! helper data structure to schedule work for parallel prime caches.
22
use std::{collections::VecDeque, hash::Hash};
33

4-
use rustc_hash::FxHashMap;
4+
use ide_db::FxHashMap;
55

66
pub(crate) struct TopologicSortIterBuilder<T> {
77
nodes: FxHashMap<T, Entry<T>>,

crates/ide/src/references.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use ide_db::{
1414
base_db::FileId,
1515
defs::{Definition, NameClass, NameRefClass},
1616
search::{ReferenceCategory, SearchScope, UsageSearchResult},
17-
RootDatabase,
17+
FxHashMap, RootDatabase,
1818
};
19-
use rustc_hash::FxHashMap;
2019
use syntax::{
2120
algo::find_node_at_offset,
2221
ast::{self, HasName},

crates/ide/src/runnables.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ use ide_db::{
99
defs::Definition,
1010
helpers::visit_file_defs,
1111
search::SearchScope,
12-
RootDatabase, SymbolKind,
12+
FxHashMap, FxHashSet, RootDatabase, SymbolKind,
1313
};
1414
use itertools::Itertools;
15-
use rustc_hash::{FxHashMap, FxHashSet};
1615
use stdx::{always, format_to};
1716
use syntax::{
1817
ast::{self, AstNode, HasAttrs as _},

crates/ide/src/shuffle_crate_graph.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::sync::Arc;
22

3-
use ide_db::base_db::salsa::Durability;
4-
use ide_db::base_db::{CrateGraph, SourceDatabase};
5-
use ide_db::RootDatabase;
6-
use rustc_hash::FxHashMap;
3+
use ide_db::{
4+
base_db::{salsa::Durability, CrateGraph, SourceDatabase},
5+
FxHashMap, RootDatabase,
6+
};
77

88
// Feature: Shuffle Crate Graph
99
//

crates/ide/src/ssr.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ mod tests {
6363
use ide_db::{
6464
base_db::{fixture::WithFixture, salsa::Durability, FileRange},
6565
symbol_index::SymbolsDatabase,
66-
RootDatabase,
66+
FxHashSet, RootDatabase,
6767
};
68-
use rustc_hash::FxHashSet;
6968

7069
use super::ssr_assists;
7170

crates/ide/src/static_index.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ use hir::{db::HirDatabase, Crate, Module, Semantics};
77
use ide_db::{
88
base_db::{FileId, FileRange, SourceDatabaseExt},
99
defs::{Definition, IdentClass},
10-
RootDatabase,
10+
FxHashSet, RootDatabase,
1111
};
12-
use rustc_hash::FxHashSet;
1312
use syntax::{AstNode, SyntaxKind::*, SyntaxToken, TextRange, T};
1413

1514
use crate::{

crates/ide/src/syntax_highlighting.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ mod html;
1414
mod tests;
1515

1616
use hir::{InFile, Name, Semantics};
17-
use ide_db::RootDatabase;
18-
use rustc_hash::FxHashMap;
17+
use ide_db::{FxHashMap, RootDatabase};
1918
use syntax::{
2019
ast, AstNode, AstToken, NodeOrToken, SyntaxKind::*, SyntaxNode, TextRange, WalkEvent, T,
2120
};

crates/ide/src/syntax_highlighting/highlight.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
use hir::{AsAssocItem, HasVisibility, Semantics};
44
use ide_db::{
55
defs::{Definition, IdentClass, NameClass, NameRefClass},
6-
RootDatabase, SymbolKind,
6+
FxHashMap, RootDatabase, SymbolKind,
77
};
8-
use rustc_hash::FxHashMap;
98
use syntax::{
109
ast, match_ast, AstNode, AstToken, NodeOrToken,
1110
SyntaxKind::{self, *},

crates/ide/src/view_crate_graph.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ use std::sync::Arc;
33
use dot::{Id, LabelText};
44
use ide_db::{
55
base_db::{CrateGraph, CrateId, Dependency, SourceDatabase, SourceDatabaseExt},
6-
RootDatabase,
6+
FxHashSet, RootDatabase,
77
};
8-
use rustc_hash::FxHashSet;
98

109
// Feature: View Crate Graph
1110
//

crates/ide_assists/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
cov-mark = "2.0.0-pre.1"
14-
rustc-hash = "1.1.0"
14+
1515
itertools = "0.10.3"
1616
either = "1.6.1"
1717

crates/ide_assists/src/handlers/extract_struct_from_enum_variant.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ use ide_db::{
77
helpers::mod_path_to_ast,
88
imports::insert_use::{insert_use, ImportScope, InsertUseConfig},
99
search::FileReference,
10-
RootDatabase,
10+
FxHashSet, RootDatabase,
1111
};
1212
use itertools::{Itertools, Position};
13-
use rustc_hash::FxHashSet;
1413
use syntax::{
1514
ast::{
1615
self, edit::IndentLevel, edit_in_place::Indent, make, AstNode, HasAttrs, HasGenericParams,

crates/ide_assists/src/handlers/generate_function.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use rustc_hash::{FxHashMap, FxHashSet};
2-
31
use hir::{HasSource, HirDisplay, Module, Semantics, TypeInfo};
42
use ide_db::{
53
base_db::FileId,
64
defs::{Definition, NameRefClass},
75
famous_defs::FamousDefs,
8-
RootDatabase, SnippetCap,
6+
FxHashMap, FxHashSet, RootDatabase, SnippetCap,
97
};
108
use stdx::to_lower_snake_case;
119
use syntax::{

crates/ide_assists/src/handlers/introduce_named_lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_hash::FxHashSet;
1+
use ide_db::FxHashSet;
22
use syntax::{
33
ast::{self, edit_in_place::GenericParamsOwnerEdit, make, HasGenericParams},
44
ted::{self, Position},

crates/ide_assists/src/handlers/reorder_fields.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use either::Either;
2+
use ide_db::FxHashMap;
23
use itertools::Itertools;
3-
use rustc_hash::FxHashMap;
4-
54
use syntax::{ast, ted, AstNode};
65

76
use crate::{AssistContext, AssistId, AssistKind, Assists};

crates/ide_assists/src/handlers/reorder_impl.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
use itertools::Itertools;
2-
use rustc_hash::FxHashMap;
3-
41
use hir::{PathResolution, Semantics};
5-
use ide_db::RootDatabase;
2+
use ide_db::{FxHashMap, RootDatabase};
3+
use itertools::Itertools;
64
use syntax::{
75
ast::{self, HasName},
86
ted, AstNode,

crates/ide_completion/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
[dependencies]
1313
cov-mark = "2.0.0-pre.1"
1414
itertools = "0.10.3"
15-
rustc-hash = "1.1.0"
15+
1616
once_cell = "1.10.0"
1717
smallvec = "1.8.0"
1818

crates/ide_completion/src/completions/attribute.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ use ide_db::{
77
Lint, CLIPPY_LINTS, CLIPPY_LINT_GROUPS, DEFAULT_LINTS, FEATURES, RUSTDOC_LINTS,
88
},
99
syntax_helpers::node_ext::parse_tt_as_comma_sep_paths,
10-
SymbolKind,
10+
FxHashMap, SymbolKind,
1111
};
1212
use itertools::Itertools;
1313
use once_cell::sync::Lazy;
14-
use rustc_hash::FxHashMap;
1514
use syntax::{
1615
ast::{self, AttrKind},
1716
AstNode, SyntaxKind, T,

crates/ide_completion/src/completions/dot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Completes references after dot (fields and method calls).
22
3-
use rustc_hash::FxHashSet;
3+
use ide_db::FxHashSet;
44

55
use crate::{context::CompletionContext, patterns::ImmediateLocation, Completions};
66

crates/ide_completion/src/completions/fn_param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! See [`complete_fn_param`].
22
33
use hir::HirDisplay;
4-
use rustc_hash::FxHashMap;
4+
use ide_db::FxHashMap;
55
use syntax::{
66
algo,
77
ast::{self, HasModuleItem},

crates/ide_completion/src/completions/mod_.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
use std::iter;
44

55
use hir::{Module, ModuleSource};
6+
use ide_db::FxHashSet;
67
use ide_db::{
78
base_db::{SourceDatabaseExt, VfsPath},
89
RootDatabase, SymbolKind,
910
};
10-
use rustc_hash::FxHashSet;
1111

1212
use crate::{context::NameContext, CompletionItem};
1313

crates/ide_completion/src/completions/pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Completes constants and paths in unqualified patterns.
22
33
use hir::{db::DefDatabase, AssocItem, ScopeDef};
4-
use rustc_hash::FxHashSet;
4+
use ide_db::FxHashSet;
55
use syntax::ast::Pat;
66

77
use crate::{

crates/ide_completion/src/completions/qualified_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Completion of paths, i.e. `some::prefix::$0`.
22
33
use hir::{ScopeDef, Trait};
4-
use rustc_hash::FxHashSet;
4+
use ide_db::FxHashSet;
55
use syntax::ast;
66

77
use crate::{

crates/ide_completion/src/completions/use_.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Completion for use trees
22
33
use hir::ScopeDef;
4-
use rustc_hash::FxHashSet;
4+
use ide_db::FxHashSet;
55
use syntax::{ast, AstNode};
66

77
use crate::{

crates/ide_completion/src/context.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ use ide_db::{
1010
active_parameter::ActiveParameter,
1111
base_db::{FilePosition, SourceDatabase},
1212
famous_defs::FamousDefs,
13-
RootDatabase,
13+
FxHashMap, FxHashSet, RootDatabase,
1414
};
15-
use rustc_hash::{FxHashMap, FxHashSet};
1615
use syntax::{
1716
algo::{find_node_at_offset, non_trivia_sibling},
1817
ast::{self, AttrKind, HasName, NameOrNameRef},

crates/ide_db/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ use hir::{
4949
db::{AstDatabase, DefDatabase, HirDatabase},
5050
symbols::FileSymbolKind,
5151
};
52-
use rustc_hash::FxHashSet;
5352

5453
use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
54+
pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
5555

5656
/// `base_db` is normally also needed in places where `ide_db` is used, so this re-export is for convenience.
5757
pub use base_db;

crates/ide_diagnostics/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ doctest = false
1212
[dependencies]
1313
cov-mark = "2.0.0-pre.1"
1414
itertools = "0.10.3"
15-
rustc-hash = "1.1.0"
15+
16+
1617
either = "1.6.1"
1718

1819
profile = { path = "../profile", version = "0.0.0" }

crates/ide_diagnostics/src/handlers/missing_fields.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use hir::{
33
db::{AstDatabase, HirDatabase},
44
known, AssocItem, HirDisplay, InFile, Type,
55
};
6-
use ide_db::{assists::Assist, famous_defs::FamousDefs, source_change::SourceChange};
7-
use rustc_hash::FxHashMap;
6+
use ide_db::{assists::Assist, famous_defs::FamousDefs, source_change::SourceChange, FxHashMap};
87
use stdx::format_to;
98
use syntax::{
109
algo,

crates/ide_diagnostics/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ use ide_db::{
5959
base_db::{FileId, SourceDatabase},
6060
label::Label,
6161
source_change::SourceChange,
62-
RootDatabase,
62+
FxHashSet, RootDatabase,
6363
};
64-
use rustc_hash::FxHashSet;
6564
use syntax::{ast::AstNode, TextRange};
6665

6766
#[derive(Copy, Clone, Debug, PartialEq)]

crates/ide_ssr/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212

1313
[dependencies]
1414
cov-mark = "2.0.0-pre.1"
15-
rustc-hash = "1.1.0"
15+
1616
itertools = "0.10.3"
1717

1818
text_edit = { path = "../text_edit", version = "0.0.0" }

0 commit comments

Comments
 (0)