diff options
author | bors <bors@rust-lang.org> | 2018-10-20 08:45:55 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2018-10-20 08:45:55 +0000 |
commit | 94273f4d8e463cac45486328294bb1c2bbc10170 (patch) | |
tree | de04f7e054e20b25d6b095ea417a42e22720a6f9 /src/librustc_errors | |
parent | 89be71a46234a2231b5b3839cd497188e072291f (diff) | |
parent | 53e92f4573f30e52a0ea241fb76c6f1ffaabff90 (diff) | |
download | rust-94273f4d8e463cac45486328294bb1c2bbc10170.tar.gz |
Auto merge of #55114 - oli-obk:fx#map, r=nikomatsakis
Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack
Diffstat (limited to 'src/librustc_errors')
-rw-r--r-- | src/librustc_errors/lib.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 12f1a43ed05..9bd95e8262f 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -382,9 +382,9 @@ impl Handler { emitter: Lock::new(e), continue_after_error: LockCell::new(true), delayed_span_bugs: Lock::new(Vec::new()), - taught_diagnostics: Lock::new(FxHashSet()), - emitted_diagnostic_codes: Lock::new(FxHashSet()), - emitted_diagnostics: Lock::new(FxHashSet()), + taught_diagnostics: Default::default(), + emitted_diagnostic_codes: Default::default(), + emitted_diagnostics: Default::default(), } } @@ -398,7 +398,8 @@ impl Handler { /// tools that want to reuse a `Parser` cleaning the previously emitted diagnostics as well as /// the overall count of emitted error diagnostics. pub fn reset_err_count(&self) { - *self.emitted_diagnostics.borrow_mut() = FxHashSet(); + // actually frees the underlying memory (which `clear` would not do) + *self.emitted_diagnostics.borrow_mut() = Default::default(); self.err_count.store(0, SeqCst); } |