Skip to content

Commit cf9f53c

Browse files
committed
Remove a redundant field
1 parent b7f8eba commit cf9f53c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
536536
}
537537
};
538538

539-
if handler.flags.dont_buffer_diagnostics || handler.flags.treat_err_as_bug.is_some() {
539+
if handler.inner.lock().flags.dont_buffer_diagnostics
540+
|| handler.inner.lock().flags.treat_err_as_bug.is_some()
541+
{
540542
self.emit();
541543
return None;
542544
}

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ use std::backtrace::{Backtrace, BacktraceStatus};
391391
/// Certain errors (fatal, bug, unimpl) may cause immediate exit,
392392
/// others log errors for later reporting.
393393
pub struct Handler {
394-
flags: HandlerFlags,
395394
inner: Lock<HandlerInner>,
396395
}
397396

@@ -589,7 +588,6 @@ impl Handler {
589588
ice_file: Option<PathBuf>,
590589
) -> Self {
591590
Self {
592-
flags,
593591
inner: Lock::new(HandlerInner {
594592
flags,
595593
lint_err_count: 0,
@@ -637,7 +635,7 @@ impl Handler {
637635
// This is here to not allow mutation of flags;
638636
// as of this writing it's only used in tests in librustc_middle.
639637
pub fn can_emit_warnings(&self) -> bool {
640-
self.flags.can_emit_warnings
638+
self.inner.lock().flags.can_emit_warnings
641639
}
642640

643641
/// Resets the diagnostic error count as well as the cached emitted diagnostics.

0 commit comments

Comments
 (0)