Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives.
This commit is contained in:
@@ -4,7 +4,8 @@ use crate::lints::{
|
||||
};
|
||||
use crate::{EarlyContext, EarlyLintPass, LintContext};
|
||||
use rustc_ast as ast;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::fx::FxIndexMap;
|
||||
use rustc_data_structures::unord::UnordMap;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
declare_lint! {
|
||||
@@ -194,8 +195,8 @@ impl EarlyLintPass for NonAsciiIdents {
|
||||
}
|
||||
|
||||
if has_non_ascii_idents && check_confusable_idents {
|
||||
let mut skeleton_map: FxHashMap<Symbol, (Symbol, Span, bool)> =
|
||||
FxHashMap::with_capacity_and_hasher(symbols.len(), Default::default());
|
||||
let mut skeleton_map: UnordMap<Symbol, (Symbol, Span, bool)> =
|
||||
UnordMap::with_capacity(symbols.len());
|
||||
let mut skeleton_buf = String::new();
|
||||
|
||||
for (&symbol, &sp) in symbols.iter() {
|
||||
@@ -248,8 +249,8 @@ impl EarlyLintPass for NonAsciiIdents {
|
||||
Verified,
|
||||
}
|
||||
|
||||
let mut script_states: FxHashMap<AugmentedScriptSet, ScriptSetUsage> =
|
||||
FxHashMap::default();
|
||||
let mut script_states: FxIndexMap<AugmentedScriptSet, ScriptSetUsage> =
|
||||
Default::default();
|
||||
let latin_augmented_script_set = AugmentedScriptSet::for_char('A');
|
||||
script_states.insert(latin_augmented_script_set, ScriptSetUsage::Verified);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user