1
Fork 0

Inline and remove DiagCtxt::with_tty_emitter

It only has two call sites, and one of those doesn't set the source map.
This commit is contained in:
Nicholas Nethercote 2024-02-29 11:40:50 +11:00
parent ca5b79ddf7
commit f9eef38e32
2 changed files with 10 additions and 13 deletions

View file

@ -59,11 +59,11 @@ pub use snippet::Style;
// See https://github.com/rust-lang/rust/pull/115393.
pub use termcolor::{Color, ColorSpec, WriteColor};
use emitter::{is_case_difference, DynEmitter, Emitter, HumanEmitter};
use emitter::{is_case_difference, DynEmitter, Emitter};
use registry::Registry;
use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
use rustc_data_structures::stable_hasher::{Hash128, StableHasher};
use rustc_data_structures::sync::{Lock, Lrc};
use rustc_data_structures::sync::Lock;
use rustc_data_structures::AtomicRef;
use rustc_lint_defs::LintExpectationId;
use rustc_span::source_map::SourceMap;
@ -586,13 +586,6 @@ impl Drop for DiagCtxtInner {
}
impl DiagCtxt {
pub fn with_tty_emitter(
sm: Option<Lrc<SourceMap>>,
fallback_bundle: LazyFallbackBundle,
) -> Self {
let emitter = Box::new(HumanEmitter::stderr(ColorConfig::Auto, fallback_bundle).sm(sm));
Self::with_emitter(emitter)
}
pub fn disable_warnings(mut self) -> Self {
self.inner.get_mut().flags.can_emit_warnings = false;
self