Skip to content

Commit 1d448af

Browse files
committed
Change FxHash to GxHash
1 parent a4ce33c commit 1d448af

File tree

360 files changed

+1672
-1636
lines changed

Some content is hidden

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

360 files changed

+1672
-1636
lines changed

Cargo.lock

+10-1
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,15 @@ dependencies = [
16401640
"serde",
16411641
]
16421642

1643+
[[package]]
1644+
name = "gxhash"
1645+
version = "3.4.1"
1646+
source = "registry+https://github.com/rust-lang/crates.io-index"
1647+
checksum = "a197c9b654827513cf53842c5c6d3da2b4b35a785f8e0eff78bdf8e445aba1bb"
1648+
dependencies = [
1649+
"rustversion",
1650+
]
1651+
16431652
[[package]]
16441653
name = "handlebars"
16451654
version = "5.1.2"
@@ -3810,14 +3819,14 @@ dependencies = [
38103819
"either",
38113820
"elsa",
38123821
"ena",
3822+
"gxhash",
38133823
"indexmap",
38143824
"jobserver",
38153825
"libc",
38163826
"measureme",
38173827
"memmap2",
38183828
"parking_lot",
38193829
"portable-atomic",
3820-
"rustc-hash",
38213830
"rustc-rayon",
38223831
"rustc_arena",
38233832
"rustc_graphviz",

blah.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hola1

compiler/rustc_ast/src/format.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::ptr::P;
22
use crate::Expr;
3-
use rustc_data_structures::fx::FxHashMap;
3+
use rustc_data_structures::gx::GxHashMap;
44
use rustc_macros::{Decodable, Encodable};
55
use rustc_span::symbol::{Ident, Symbol};
66
use rustc_span::Span;
@@ -65,14 +65,14 @@ pub struct FormatArguments {
6565
arguments: Vec<FormatArgument>,
6666
num_unnamed_args: usize,
6767
num_explicit_args: usize,
68-
names: FxHashMap<Symbol, usize>,
68+
names: GxHashMap<Symbol, usize>,
6969
}
7070

7171
impl FormatArguments {
7272
pub fn new() -> Self {
7373
Self {
7474
arguments: Vec::new(),
75-
names: FxHashMap::default(),
75+
names: GxHashMap::default(),
7676
num_unnamed_args: 0,
7777
num_explicit_args: 0,
7878
}

compiler/rustc_ast_lowering/src/asm.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use super::LoweringContext;
1111

1212
use rustc_ast::ptr::P;
1313
use rustc_ast::*;
14-
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
14+
use rustc_data_structures::gx::{GxHashMap, GxHashSet, GxIndexMap};
1515
use rustc_hir as hir;
1616
use rustc_hir::def::{DefKind, Res};
1717
use rustc_session::parse::feature_err;
@@ -68,7 +68,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
6868
.emit();
6969
}
7070

71-
let mut clobber_abis = FxIndexMap::default();
71+
let mut clobber_abis = GxIndexMap::default();
7272
if let Some(asm_arch) = asm_arch {
7373
for (abi_name, abi_span) in &asm.clobber_abis {
7474
match asm::InlineAsmClobberAbi::parse(asm_arch, &self.tcx.sess.target, *abi_name) {
@@ -318,8 +318,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
318318
}
319319
}
320320

321-
let mut used_input_regs = FxHashMap::default();
322-
let mut used_output_regs = FxHashMap::default();
321+
let mut used_input_regs = GxHashMap::default();
322+
let mut used_output_regs = GxHashMap::default();
323323

324324
for (idx, &(ref op, op_sp)) in operands.iter().enumerate() {
325325
if let Some(reg) = op.reg() {
@@ -362,7 +362,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
362362
// Flag to output the error only once per operand
363363
let mut skip = false;
364364

365-
let mut check = |used_regs: &mut FxHashMap<asm::InlineAsmReg, usize>,
365+
let mut check = |used_regs: &mut GxHashMap<asm::InlineAsmReg, usize>,
366366
input,
367367
r: asm::InlineAsmReg| {
368368
match used_regs.entry(r) {
@@ -436,7 +436,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
436436

437437
// If a clobber_abi is specified, add the necessary clobbers to the
438438
// operands list.
439-
let mut clobbered = FxHashSet::default();
439+
let mut clobbered = GxHashSet::default();
440440
for (abi, (_, abi_span)) in clobber_abis {
441441
for &clobber in abi.clobbered_regs() {
442442
// Don't emit a clobber for a register already clobbered

compiler/rustc_ast_lowering/src/format.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::ops::ControlFlow;
33
use rustc_ast as ast;
44
use rustc_ast::visit::Visitor;
55
use rustc_ast::*;
6-
use rustc_data_structures::fx::FxIndexMap;
6+
use rustc_data_structures::gx::GxIndexMap;
77
use rustc_hir as hir;
88
use rustc_span::{
99
sym,
@@ -282,7 +282,7 @@ fn make_count<'hir>(
282282
ctx: &mut LoweringContext<'_, 'hir>,
283283
sp: Span,
284284
count: &Option<FormatCount>,
285-
argmap: &mut FxIndexMap<(usize, ArgumentType), Option<Span>>,
285+
argmap: &mut GxIndexMap<(usize, ArgumentType), Option<Span>>,
286286
) -> hir::Expr<'hir> {
287287
match count {
288288
Some(FormatCount::Literal(n)) => {
@@ -335,7 +335,7 @@ fn make_format_spec<'hir>(
335335
ctx: &mut LoweringContext<'_, 'hir>,
336336
sp: Span,
337337
placeholder: &FormatPlaceholder,
338-
argmap: &mut FxIndexMap<(usize, ArgumentType), Option<Span>>,
338+
argmap: &mut GxIndexMap<(usize, ArgumentType), Option<Span>>,
339339
) -> hir::Expr<'hir> {
340340
let position = match placeholder.argument.index {
341341
Ok(arg_index) => {
@@ -432,7 +432,7 @@ fn expand_format_args<'hir>(
432432

433433
// Create a list of all _unique_ (argument, format trait) combinations.
434434
// E.g. "{0} {0:x} {0} {1}" -> [(0, Display), (0, LowerHex), (1, Display)]
435-
let mut argmap = FxIndexMap::default();
435+
let mut argmap = GxIndexMap::default();
436436
for piece in &fmt.template {
437437
let FormatArgsPiece::Placeholder(placeholder) = piece else { continue };
438438
if placeholder.format_options != Default::default() {

compiler/rustc_ast_lowering/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use rustc_ast::{self as ast, *};
4646
use rustc_ast_pretty::pprust;
4747
use rustc_data_structures::captures::Captures;
4848
use rustc_data_structures::fingerprint::Fingerprint;
49-
use rustc_data_structures::fx::FxIndexSet;
49+
use rustc_data_structures::gx::GxIndexSet;
5050
use rustc_data_structures::sorted_map::SortedMap;
5151
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
5252
use rustc_data_structures::sync::Lrc;
@@ -1630,7 +1630,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16301630
opaque_ty_node_id: NodeId,
16311631
origin: hir::OpaqueTyOrigin,
16321632
in_trait: bool,
1633-
captured_lifetimes_to_duplicate: FxIndexSet<Lifetime>,
1633+
captured_lifetimes_to_duplicate: GxIndexSet<Lifetime>,
16341634
span: Span,
16351635
opaque_ty_span: Span,
16361636
lower_item_bounds: impl FnOnce(&mut Self) -> &'hir [hir::GenericBound<'hir>],

compiler/rustc_ast_lowering/src/lifetime_collector.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::ResolverAstLoweringExt;
22
use rustc_ast::visit::{self, BoundKind, LifetimeCtxt, Visitor};
33
use rustc_ast::{GenericBounds, Lifetime, NodeId, PathSegment, PolyTraitRef, Ty, TyKind};
4-
use rustc_data_structures::fx::FxIndexSet;
4+
use rustc_data_structures::gx::GxIndexSet;
55
use rustc_hir::def::{DefKind, LifetimeRes, Res};
66
use rustc_middle::span_bug;
77
use rustc_middle::ty::ResolverAstLowering;
@@ -11,12 +11,12 @@ use rustc_span::Span;
1111
struct LifetimeCollectVisitor<'ast> {
1212
resolver: &'ast ResolverAstLowering,
1313
current_binders: Vec<NodeId>,
14-
collected_lifetimes: FxIndexSet<Lifetime>,
14+
collected_lifetimes: GxIndexSet<Lifetime>,
1515
}
1616

1717
impl<'ast> LifetimeCollectVisitor<'ast> {
1818
fn new(resolver: &'ast ResolverAstLowering) -> Self {
19-
Self { resolver, current_binders: Vec::new(), collected_lifetimes: FxIndexSet::default() }
19+
Self { resolver, current_binders: Vec::new(), collected_lifetimes: GxIndexSet::default() }
2020
}
2121

2222
fn record_lifetime_use(&mut self, lifetime: Lifetime) {
@@ -108,7 +108,7 @@ impl<'ast> Visitor<'ast> for LifetimeCollectVisitor<'ast> {
108108
pub(crate) fn lifetimes_in_bounds(
109109
resolver: &ResolverAstLowering,
110110
bounds: &GenericBounds,
111-
) -> FxIndexSet<Lifetime> {
111+
) -> GxIndexSet<Lifetime> {
112112
let mut visitor = LifetimeCollectVisitor::new(resolver);
113113
for bound in bounds {
114114
visitor.visit_param_bound(bound, BoundKind::Bound);

compiler/rustc_ast_passes/src/ast_validation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_ast::ptr::P;
1111
use rustc_ast::visit::{walk_list, AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor};
1212
use rustc_ast::*;
1313
use rustc_ast_pretty::pprust::{self, State};
14-
use rustc_data_structures::fx::FxIndexMap;
14+
use rustc_data_structures::gx::GxIndexMap;
1515
use rustc_errors::DiagCtxtHandle;
1616
use rustc_feature::Features;
1717
use rustc_parse::validate_attr;
@@ -828,7 +828,7 @@ impl<'a> AstValidator<'a> {
828828
/// which is lifetimes, then types and then consts. (`<'a, T, const N: usize>`)
829829
fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericParam], span: Span) {
830830
let mut max_param: Option<ParamKindOrd> = None;
831-
let mut out_of_order = FxIndexMap::default();
831+
let mut out_of_order = GxIndexMap::default();
832832
let mut param_idents = Vec::with_capacity(generics.len());
833833

834834
for (idx, param) in generics.iter().enumerate() {

compiler/rustc_borrowck/src/borrow_set.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::path_utils::allow_two_phase_borrow;
22
use crate::place_ext::PlaceExt;
33
use crate::BorrowIndex;
4-
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
4+
use rustc_data_structures::gx::{GxIndexMap, GxIndexSet};
55
use rustc_index::bit_set::BitSet;
66
use rustc_middle::mir::traversal;
77
use rustc_middle::mir::visit::{MutatingUseContext, NonUseContext, PlaceContext, Visitor};
@@ -18,16 +18,16 @@ pub struct BorrowSet<'tcx> {
1818
/// by the `Location` of the assignment statement in which it
1919
/// appears on the right hand side. Thus the location is the map
2020
/// key, and its position in the map corresponds to `BorrowIndex`.
21-
pub location_map: FxIndexMap<Location, BorrowData<'tcx>>,
21+
pub location_map: GxIndexMap<Location, BorrowData<'tcx>>,
2222

2323
/// Locations which activate borrows.
2424
/// NOTE: a given location may activate more than one borrow in the future
2525
/// when more general two-phase borrow support is introduced, but for now we
2626
/// only need to store one borrow index.
27-
pub activation_map: FxIndexMap<Location, Vec<BorrowIndex>>,
27+
pub activation_map: GxIndexMap<Location, Vec<BorrowIndex>>,
2828

2929
/// Map from local to all the borrows on that local.
30-
pub local_map: FxIndexMap<mir::Local, FxIndexSet<BorrowIndex>>,
30+
pub local_map: GxIndexMap<mir::Local, GxIndexSet<BorrowIndex>>,
3131

3232
pub locals_state_at_exit: LocalsStateAtExit,
3333
}
@@ -174,9 +174,9 @@ impl<'tcx> BorrowSet<'tcx> {
174174
struct GatherBorrows<'a, 'tcx> {
175175
tcx: TyCtxt<'tcx>,
176176
body: &'a Body<'tcx>,
177-
location_map: FxIndexMap<Location, BorrowData<'tcx>>,
178-
activation_map: FxIndexMap<Location, Vec<BorrowIndex>>,
179-
local_map: FxIndexMap<mir::Local, FxIndexSet<BorrowIndex>>,
177+
location_map: GxIndexMap<Location, BorrowData<'tcx>>,
178+
activation_map: GxIndexMap<Location, Vec<BorrowIndex>>,
179+
local_map: GxIndexMap<mir::Local, GxIndexSet<BorrowIndex>>,
180180

181181
/// When we encounter a 2-phase borrow statement, it will always
182182
/// be assigning into a temporary TEMP:
@@ -186,7 +186,7 @@ struct GatherBorrows<'a, 'tcx> {
186186
/// We add TEMP into this map with `b`, where `b` is the index of
187187
/// the borrow. When we find a later use of this activation, we
188188
/// remove from the map (and add to the "tombstone" set below).
189-
pending_activations: FxIndexMap<mir::Local, BorrowIndex>,
189+
pending_activations: GxIndexMap<mir::Local, BorrowIndex>,
190190

191191
locals_state_at_exit: LocalsStateAtExit,
192192
}

compiler/rustc_borrowck/src/dataflow.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use rustc_data_structures::fx::FxIndexMap;
21
use rustc_data_structures::graph;
2+
use rustc_data_structures::gx::GxIndexMap;
33
use rustc_index::bit_set::BitSet;
44
use rustc_middle::mir::{
55
self, BasicBlock, Body, CallReturnPlaces, Location, Place, TerminatorEdges,
@@ -111,15 +111,15 @@ pub struct Borrows<'mir, 'tcx> {
111111
body: &'mir Body<'tcx>,
112112

113113
borrow_set: &'mir BorrowSet<'tcx>,
114-
borrows_out_of_scope_at_location: FxIndexMap<Location, Vec<BorrowIndex>>,
114+
borrows_out_of_scope_at_location: GxIndexMap<Location, Vec<BorrowIndex>>,
115115
}
116116

117117
struct OutOfScopePrecomputer<'mir, 'tcx> {
118118
visited: BitSet<mir::BasicBlock>,
119119
visit_stack: Vec<mir::BasicBlock>,
120120
body: &'mir Body<'tcx>,
121121
regioncx: &'mir RegionInferenceContext<'tcx>,
122-
borrows_out_of_scope_at_location: FxIndexMap<Location, Vec<BorrowIndex>>,
122+
borrows_out_of_scope_at_location: GxIndexMap<Location, Vec<BorrowIndex>>,
123123
}
124124

125125
impl<'mir, 'tcx> OutOfScopePrecomputer<'mir, 'tcx> {
@@ -129,7 +129,7 @@ impl<'mir, 'tcx> OutOfScopePrecomputer<'mir, 'tcx> {
129129
visit_stack: vec![],
130130
body,
131131
regioncx,
132-
borrows_out_of_scope_at_location: FxIndexMap::default(),
132+
borrows_out_of_scope_at_location: GxIndexMap::default(),
133133
}
134134
}
135135
}
@@ -214,7 +214,7 @@ pub fn calculate_borrows_out_of_scope_at_location<'tcx>(
214214
body: &Body<'tcx>,
215215
regioncx: &RegionInferenceContext<'tcx>,
216216
borrow_set: &BorrowSet<'tcx>,
217-
) -> FxIndexMap<Location, Vec<BorrowIndex>> {
217+
) -> GxIndexMap<Location, Vec<BorrowIndex>> {
218218
let mut prec = OutOfScopePrecomputer::new(body, regioncx);
219219
for (borrow_index, borrow_data) in borrow_set.iter_enumerated() {
220220
let borrow_region = borrow_data.region;
@@ -232,7 +232,7 @@ struct PoloniusOutOfScopePrecomputer<'mir, 'tcx> {
232232
body: &'mir Body<'tcx>,
233233
regioncx: &'mir RegionInferenceContext<'tcx>,
234234

235-
loans_out_of_scope_at_location: FxIndexMap<Location, Vec<BorrowIndex>>,
235+
loans_out_of_scope_at_location: GxIndexMap<Location, Vec<BorrowIndex>>,
236236
}
237237

238238
impl<'mir, 'tcx> PoloniusOutOfScopePrecomputer<'mir, 'tcx> {
@@ -242,7 +242,7 @@ impl<'mir, 'tcx> PoloniusOutOfScopePrecomputer<'mir, 'tcx> {
242242
visit_stack: vec![],
243243
body,
244244
regioncx,
245-
loans_out_of_scope_at_location: FxIndexMap::default(),
245+
loans_out_of_scope_at_location: GxIndexMap::default(),
246246
}
247247
}
248248
}

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use either::Either;
77
use hir::ClosureKind;
88
use rustc_data_structures::captures::Captures;
9-
use rustc_data_structures::fx::FxIndexSet;
9+
use rustc_data_structures::gx::GxIndexSet;
1010
use rustc_errors::{codes::*, struct_span_code_err, Applicability, Diag, MultiSpan};
1111
use rustc_hir as hir;
1212
use rustc_hir::def::{DefKind, Res};
@@ -186,7 +186,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
186186

187187
let mut is_loop_move = false;
188188
let mut in_pattern = false;
189-
let mut seen_spans = FxIndexSet::default();
189+
let mut seen_spans = GxIndexSet::default();
190190

191191
for move_site in &move_site_vec {
192192
let move_out = self.move_data.moves[(*move_site).moi];
@@ -1831,7 +1831,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
18311831
}
18321832
}
18331833

1834-
let mut types_to_constrain = FxIndexSet::default();
1834+
let mut types_to_constrain = GxIndexSet::default();
18351835

18361836
let local_ty = self.body.local_decls[place.local].ty;
18371837
let typeck_results = tcx.typeck(self.mir_def_id());
@@ -3485,8 +3485,8 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
34853485
}
34863486
}
34873487

3488-
let mut visited = FxIndexSet::default();
3489-
let mut move_locations = FxIndexSet::default();
3488+
let mut visited = GxIndexSet::default();
3489+
let mut move_locations = GxIndexSet::default();
34903490
let mut reinits = vec![];
34913491
let mut result = vec![];
34923492

@@ -3613,7 +3613,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
36133613
let reinits_reachable = reinits
36143614
.into_iter()
36153615
.filter(|reinit| {
3616-
let mut visited = FxIndexSet::default();
3616+
let mut visited = GxIndexSet::default();
36173617
let mut stack = vec![*reinit];
36183618
while let Some(location) = stack.pop() {
36193619
if !visited.insert(location) {

compiler/rustc_borrowck/src/diagnostics/find_use.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{
55
def_use::{self, DefUse},
66
region_infer::{Cause, RegionInferenceContext},
77
};
8-
use rustc_data_structures::fx::FxIndexSet;
8+
use rustc_data_structures::gx::GxIndexSet;
99
use rustc_middle::mir::visit::{MirVisitable, PlaceContext, Visitor};
1010
use rustc_middle::mir::{self, Body, Local, Location};
1111
use rustc_middle::ty::{RegionVid, TyCtxt};
@@ -33,7 +33,7 @@ struct UseFinder<'cx, 'tcx> {
3333
impl<'cx, 'tcx> UseFinder<'cx, 'tcx> {
3434
fn find(&mut self) -> Option<Cause> {
3535
let mut queue = VecDeque::new();
36-
let mut visited = FxIndexSet::default();
36+
let mut visited = GxIndexSet::default();
3737

3838
queue.push_back(self.start_point);
3939
while let Some(p) = queue.pop_front() {

0 commit comments

Comments
 (0)