about summary refs log tree commit diff
path: root/src/librustc_errors/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-02 06:08:24 +0000
committerbors <bors@rust-lang.org>2019-10-02 06:08:24 +0000
commitf2023ac599c38a59f86552089e6791c5a73412d3 (patch)
treee2ebd2336ca270269b57cc3660640339a182c0c2 /src/librustc_errors/lib.rs
parentff191b54cc8a95e3bfc7ae5f8f9984f934758165 (diff)
parent0878ca51f08d20499e04feda142c5e0ab44a628b (diff)
downloadrust-f2023ac599c38a59f86552089e6791c5a73412d3.tar.gz
rust-f2023ac599c38a59f86552089e6791c5a73412d3.zip
Auto merge of #64981 - tmandry:rollup-slfkhay, r=tmandry
Rollup of 11 pull requests

Successful merges:

 - #64649 (Avoid ICE on return outside of fn with literal array)
 - #64722 (Make all alt builders produce parallel-enabled compilers)
 - #64801 (Avoid `chain()` in `find_constraint_paths_between_regions()`.)
 - #64805 (Still more `ObligationForest` improvements.)
 - #64840 (SelfProfiler API refactoring and part one of event review)
 - #64885 (use try_fold instead of try_for_each to reduce compile time)
 - #64942 (Fix clippy warnings)
 - #64952 (Update cargo.)
 - #64974 (Fix zebra-striping in generic dataflow visualization)
 - #64978 (Fully clear `HandlerInner` in `Handler::reset_err_count`)
 - #64979 (Update books)

Failed merges:

 - #64959 (syntax: improve parameter without type suggestions)

r? @ghost
Diffstat (limited to 'src/librustc_errors/lib.rs')
-rw-r--r--src/librustc_errors/lib.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index c01dcd94c72..f9dc13ce97e 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -469,14 +469,17 @@ impl Handler {
     /// NOTE: *do not* call this function from rustc. It is only meant to be called from external
     /// tools that want to reuse a `Parser` cleaning the previously emitted diagnostics as well as
     /// the overall count of emitted error diagnostics.
-    // FIXME: this does not clear inner entirely
     pub fn reset_err_count(&self) {
         let mut inner = self.inner.borrow_mut();
-        // actually frees the underlying memory (which `clear` would not do)
-        inner.emitted_diagnostics = Default::default();
-        inner.deduplicated_err_count = 0;
         inner.err_count = 0;
-        inner.stashed_diagnostics.clear();
+        inner.deduplicated_err_count = 0;
+
+        // actually free the underlying memory (which `clear` would not do)
+        inner.delayed_span_bugs = Default::default();
+        inner.taught_diagnostics = Default::default();
+        inner.emitted_diagnostic_codes = Default::default();
+        inner.emitted_diagnostics = Default::default();
+        inner.stashed_diagnostics = Default::default();
     }
 
     /// Stash a given diagnostic with the given `Span` and `StashKey` as the key for later stealing.