diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2018-08-30 20:15:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-30 20:15:29 +0200 |
| commit | ba832707cfb8dc4e3f22f18f86a00061772d5f07 (patch) | |
| tree | 55d19c1b76e78a31fbbd56bc9ba4da310bd63705 /src/libsyntax/parse | |
| parent | 0c8b8e8b4232796598d36a02388e48a0c1c3a622 (diff) | |
| parent | 93f3f5b1552489dbee03020505d896f01fd53852 (diff) | |
| download | rust-ba832707cfb8dc4e3f22f18f86a00061772d5f07.tar.gz rust-ba832707cfb8dc4e3f22f18f86a00061772d5f07.zip | |
Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelix
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.
Most of the compiler uses the `Fx` hasher but some places ended up with the default one.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 448ff9676c9..96584a580f1 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1831,10 +1831,10 @@ mod tests { use errors; use feature_gate::UnstableFeatures; use parse::token; - use std::collections::HashSet; use std::io; use std::path::PathBuf; use diagnostics::plugin::ErrorMap; + use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::sync::Lock; use with_globals; fn mk_sess(cm: Lrc<SourceMap>) -> ParseSess { @@ -1845,10 +1845,10 @@ mod tests { ParseSess { span_diagnostic: errors::Handler::with_emitter(true, false, Box::new(emitter)), unstable_features: UnstableFeatures::from_environment(), - config: CrateConfig::new(), + config: CrateConfig::default(), included_mod_stack: Lock::new(Vec::new()), code_map: cm, - missing_fragment_specifiers: Lock::new(HashSet::new()), + missing_fragment_specifiers: Lock::new(FxHashSet::default()), raw_identifier_spans: Lock::new(Vec::new()), registered_diagnostics: Lock::new(ErrorMap::new()), non_modrs_mods: Lock::new(vec![]), diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 1136cda5ee3..28d63399b44 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -24,8 +24,8 @@ use symbol::Symbol; use tokenstream::{TokenStream, TokenTree}; use diagnostics::plugin::ErrorMap; +use rustc_data_structures::fx::FxHashSet; use std::borrow::Cow; -use std::collections::HashSet; use std::iter; use std::path::{Path, PathBuf}; use std::str; @@ -46,7 +46,7 @@ pub struct ParseSess { pub span_diagnostic: Handler, pub unstable_features: UnstableFeatures, pub config: CrateConfig, - pub missing_fragment_specifiers: Lock<HashSet<Span>>, + pub missing_fragment_specifiers: Lock<FxHashSet<Span>>, /// Places where raw identifiers were used. This is used for feature gating /// raw identifiers pub raw_identifier_spans: Lock<Vec<Span>>, @@ -75,8 +75,8 @@ impl ParseSess { ParseSess { span_diagnostic: handler, unstable_features: UnstableFeatures::from_environment(), - config: HashSet::new(), - missing_fragment_specifiers: Lock::new(HashSet::new()), + config: FxHashSet::default(), + missing_fragment_specifiers: Lock::new(FxHashSet::default()), raw_identifier_spans: Lock::new(Vec::new()), registered_diagnostics: Lock::new(ErrorMap::new()), included_mod_stack: Lock::new(vec![]), |
