diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-08-18 13:55:43 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-08-28 17:04:04 +0300 |
| commit | 93f3f5b1552489dbee03020505d896f01fd53852 (patch) | |
| tree | 19ccbcb3c491764f5ae6d3b65e1e0f76f450ce55 /src/librustc_errors | |
| parent | 83ddc33347cade429fdb47509818e775a67c1af6 (diff) | |
| download | rust-93f3f5b1552489dbee03020505d896f01fd53852.tar.gz rust-93f3f5b1552489dbee03020505d896f01fd53852.zip | |
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 6 | ||||
| -rw-r--r-- | src/librustc_errors/registry.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index c08cf3d039d..5f275b70038 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -16,12 +16,12 @@ use {Level, CodeSuggestion, DiagnosticBuilder, SubDiagnostic, SourceMapperDyn, D use snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, StyledString, Style}; use styled_buffer::StyledBuffer; +use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::sync::Lrc; use atty; use std::borrow::Cow; use std::io::prelude::*; use std::io; -use std::collections::HashMap; use std::cmp::{min, Reverse}; use termcolor::{StandardStream, ColorChoice, ColorSpec, BufferWriter}; use termcolor::{WriteColor, Color, Buffer}; @@ -1090,7 +1090,7 @@ impl EmitterWriter { max_line_num_len + 1); // Contains the vertical lines' positions for active multiline annotations - let mut multilines = HashMap::new(); + let mut multilines = FxHashMap::default(); // Next, output the annotate source for this file for line_idx in 0..annotated_file.lines.len() { @@ -1109,7 +1109,7 @@ impl EmitterWriter { width_offset, code_offset); - let mut to_add = HashMap::new(); + let mut to_add = FxHashMap::default(); for (depth, style) in depths { if multilines.get(&depth).is_some() { diff --git a/src/librustc_errors/registry.rs b/src/librustc_errors/registry.rs index 83737681471..9a2302171ba 100644 --- a/src/librustc_errors/registry.rs +++ b/src/librustc_errors/registry.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::collections::HashMap; +use rustc_data_structures::fx::FxHashMap; #[derive(Clone)] pub struct Registry { - descriptions: HashMap<&'static str, &'static str>, + descriptions: FxHashMap<&'static str, &'static str>, } impl Registry { |
