Rollup merge of #119601 - nnethercote:Emitter-cleanups, r=oli-obk

`Emitter` cleanups

Some improvements I found while looking at this code.

r? `@oli-obk`
This commit is contained in:
Michael Goulet 2024-01-05 10:57:24 -05:00 committed by GitHub
commit da700b39df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 465 additions and 52 deletions

View file

@ -53,7 +53,7 @@ pub use snippet::Style;
pub use termcolor::{Color, ColorSpec, WriteColor};
use crate::diagnostic_impls::{DelayedAtWithNewline, DelayedAtWithoutNewline};
use emitter::{is_case_difference, DynEmitter, Emitter, EmitterWriter};
use emitter::{is_case_difference, DynEmitter, Emitter, HumanEmitter};
use registry::Registry;
use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
use rustc_data_structures::stable_hasher::{Hash128, StableHasher};
@ -571,7 +571,7 @@ impl DiagCtxt {
sm: Option<Lrc<SourceMap>>,
fallback_bundle: LazyFallbackBundle,
) -> Self {
let emitter = Box::new(EmitterWriter::stderr(ColorConfig::Auto, fallback_bundle).sm(sm));
let emitter = Box::new(HumanEmitter::stderr(ColorConfig::Auto, fallback_bundle).sm(sm));
Self::with_emitter(emitter)
}
pub fn disable_warnings(mut self) -> Self {