Change CrateConfig from FxIndexSet to FxHashSet.

Because its order doesn't matter. This is well demonstrated by
`to_crate_config`, which creates a `CrateConfig` from an `FxHashSet`.
This commit is contained in:
Nicholas Nethercote 2023-10-27 15:49:09 +11:00
parent 2142d014ab
commit 32986d895f

View File

@ -9,7 +9,7 @@ use crate::lint::{
builtin::UNSTABLE_SYNTAX_PRE_EXPANSION, BufferedEarlyLint, BuiltinLintDiagnostics, Lint, LintId,
};
use rustc_ast::node_id::NodeId;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc};
use rustc_errors::{emitter::SilentEmitter, Handler};
use rustc_errors::{
@ -27,7 +27,7 @@ use std::str;
/// The set of keys (and, optionally, values) that define the compilation
/// environment of the crate, used to drive conditional compilation.
pub type CrateConfig = FxIndexSet<(Symbol, Option<Symbol>)>;
pub type CrateConfig = FxHashSet<(Symbol, Option<Symbol>)>;
pub type CrateCheckConfig = CheckCfg<Symbol>;
/// Collected spans during parsing for places where a certain feature was
@ -237,7 +237,7 @@ impl ParseSess {
Self {
span_diagnostic: handler,
unstable_features: UnstableFeatures::from_environment(None),
config: FxIndexSet::default(),
config: FxHashSet::default(),
check_config: CrateCheckConfig::default(),
edition: ExpnId::root().expn_data().edition,
raw_identifier_spans: Default::default(),