diff options
| author | AnthonyMikh <anthony.mikh@yandex.ru> | 2019-10-02 04:13:02 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-02 04:13:02 +0300 |
| commit | bd7cd80299e949bf2018595da756b214a188884f (patch) | |
| tree | 6adf4bc70f12035325231d6c0b6d6802815d8bd4 /src/librustc_errors | |
| parent | 702b45e409495a41afcccbe87a251a692b0cefab (diff) | |
| download | rust-bd7cd80299e949bf2018595da756b214a188884f.tar.gz rust-bd7cd80299e949bf2018595da756b214a188884f.zip | |
Fully clear `HandlerInner` in `Handler::reset_err_count`
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/lib.rs | 13 |
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. |
