about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2018-10-16 19:59:44 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2018-10-19 14:34:44 +0200
commitab3f37ec43b0ca842baf5d79416eb0f86195cda6 (patch)
treebe5bbaff3069742a7a26e0956448f50fbc5c8cd8 /src/librustc_errors
parent55f76628ee053f8e331c1898f20aaefe4dd9bc7f (diff)
downloadrust-ab3f37ec43b0ca842baf5d79416eb0f86195cda6.tar.gz
rust-ab3f37ec43b0ca842baf5d79416eb0f86195cda6.zip
Free some memory instead of just dropping elements
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index f02a5e2bc5d..9bd95e8262f 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -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().clear();
+        // actually frees the underlying memory (which `clear` would not do)
+        *self.emitted_diagnostics.borrow_mut() = Default::default();
         self.err_count.store(0, SeqCst);
     }