1
Fork 0

Remove a redundant field

This commit is contained in:
Oli Scherer 2023-07-25 10:10:04 +00:00
parent b7f8eba9fd
commit cf9f53c837
2 changed files with 4 additions and 4 deletions

View file

@ -536,7 +536,9 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
} }
}; };
if handler.flags.dont_buffer_diagnostics || handler.flags.treat_err_as_bug.is_some() { if handler.inner.lock().flags.dont_buffer_diagnostics
|| handler.inner.lock().flags.treat_err_as_bug.is_some()
{
self.emit(); self.emit();
return None; return None;
} }

View file

@ -391,7 +391,6 @@ use std::backtrace::{Backtrace, BacktraceStatus};
/// Certain errors (fatal, bug, unimpl) may cause immediate exit, /// Certain errors (fatal, bug, unimpl) may cause immediate exit,
/// others log errors for later reporting. /// others log errors for later reporting.
pub struct Handler { pub struct Handler {
flags: HandlerFlags,
inner: Lock<HandlerInner>, inner: Lock<HandlerInner>,
} }
@ -589,7 +588,6 @@ impl Handler {
ice_file: Option<PathBuf>, ice_file: Option<PathBuf>,
) -> Self { ) -> Self {
Self { Self {
flags,
inner: Lock::new(HandlerInner { inner: Lock::new(HandlerInner {
flags, flags,
lint_err_count: 0, lint_err_count: 0,
@ -637,7 +635,7 @@ impl Handler {
// This is here to not allow mutation of flags; // This is here to not allow mutation of flags;
// as of this writing it's only used in tests in librustc_middle. // as of this writing it's only used in tests in librustc_middle.
pub fn can_emit_warnings(&self) -> bool { pub fn can_emit_warnings(&self) -> bool {
self.flags.can_emit_warnings self.inner.lock().flags.can_emit_warnings
} }
/// Resets the diagnostic error count as well as the cached emitted diagnostics. /// Resets the diagnostic error count as well as the cached emitted diagnostics.