Rename HandlerFlags
as DiagCtxtFlags
.
This commit is contained in:
parent
cce1701c4c
commit
9b1f87c7e8
@ -40,7 +40,7 @@ fn into_diagnostic(self, handler: &'a DiagCtxt) -> DiagnosticBuilder<'a, G> {
|
||||
///
|
||||
/// If there is some state in a downstream crate you would like to
|
||||
/// access in the methods of `DiagnosticBuilder` here, consider
|
||||
/// extending `HandlerFlags`, accessed via `self.handler.flags`.
|
||||
/// extending `DiagCtxtFlags`.
|
||||
#[must_use]
|
||||
#[derive(Clone)]
|
||||
pub struct DiagnosticBuilder<'a, G: EmissionGuarantee> {
|
||||
|
@ -420,7 +420,7 @@ pub struct DiagCtxt {
|
||||
/// this is done to prevent possible deadlocks in a multi-threaded compiler,
|
||||
/// as well as inconsistent state observation.
|
||||
struct DiagCtxtInner {
|
||||
flags: HandlerFlags,
|
||||
flags: DiagCtxtFlags,
|
||||
/// The number of lint errors that have been emitted.
|
||||
lint_err_count: usize,
|
||||
/// The number of errors that have been emitted, including duplicates.
|
||||
@ -518,7 +518,7 @@ fn default_track_diagnostic(d: &mut Diagnostic, f: &mut dyn FnMut(&mut Diagnosti
|
||||
AtomicRef::new(&(default_track_diagnostic as _));
|
||||
|
||||
#[derive(Copy, Clone, Default)]
|
||||
pub struct HandlerFlags {
|
||||
pub struct DiagCtxtFlags {
|
||||
/// If false, warning-level lints are suppressed.
|
||||
/// (rustc: see `--allow warnings` and `--cap-lints`)
|
||||
pub can_emit_warnings: bool,
|
||||
@ -585,7 +585,7 @@ pub fn disable_warnings(mut self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_flags(mut self, flags: HandlerFlags) -> Self {
|
||||
pub fn with_flags(mut self, flags: DiagCtxtFlags) -> Self {
|
||||
self.inner.get_mut().flags = flags;
|
||||
self
|
||||
}
|
||||
@ -598,7 +598,7 @@ pub fn with_ice_file(mut self, ice_file: PathBuf) -> Self {
|
||||
pub fn with_emitter(emitter: Box<DynEmitter>) -> Self {
|
||||
Self {
|
||||
inner: Lock::new(DiagCtxtInner {
|
||||
flags: HandlerFlags { can_emit_warnings: true, ..Default::default() },
|
||||
flags: DiagCtxtFlags { can_emit_warnings: true, ..Default::default() },
|
||||
lint_err_count: 0,
|
||||
err_count: 0,
|
||||
warn_count: 0,
|
||||
|
@ -11,7 +11,7 @@
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
|
||||
use rustc_data_structures::stable_hasher::{StableOrd, ToStableHashKey};
|
||||
use rustc_errors::emitter::HumanReadableErrorType;
|
||||
use rustc_errors::{ColorConfig, DiagnosticArgValue, HandlerFlags, IntoDiagnosticArg};
|
||||
use rustc_errors::{ColorConfig, DiagCtxtFlags, DiagnosticArgValue, IntoDiagnosticArg};
|
||||
use rustc_feature::UnstableFeatures;
|
||||
use rustc_span::edition::{Edition, DEFAULT_EDITION, EDITION_NAME_LIST, LATEST_STABLE_EDITION};
|
||||
use rustc_span::source_map::FilePathMapping;
|
||||
@ -1155,8 +1155,8 @@ pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion {
|
||||
}
|
||||
|
||||
impl UnstableOptions {
|
||||
pub fn diagnostic_handler_flags(&self, can_emit_warnings: bool) -> HandlerFlags {
|
||||
HandlerFlags {
|
||||
pub fn diagnostic_handler_flags(&self, can_emit_warnings: bool) -> DiagCtxtFlags {
|
||||
DiagCtxtFlags {
|
||||
can_emit_warnings,
|
||||
treat_err_as_bug: self.treat_err_as_bug,
|
||||
dont_buffer_diagnostics: self.dont_buffer_diagnostics,
|
||||
|
Loading…
Reference in New Issue
Block a user