Rename DiagCtxt::with_emitter
as DiagCtxt::new
.
Because it's now the only constructor.
This commit is contained in:
parent
f9eef38e32
commit
880c1c585f
12 changed files with 20 additions and 20 deletions
|
@ -239,7 +239,7 @@ impl ParseSess {
|
|||
let sm = Lrc::new(SourceMap::new(file_path_mapping));
|
||||
let emitter =
|
||||
Box::new(HumanEmitter::stderr(ColorConfig::Auto, fallback_bundle).sm(Some(sm.clone())));
|
||||
let dcx = DiagCtxt::with_emitter(emitter);
|
||||
let dcx = DiagCtxt::new(emitter);
|
||||
ParseSess::with_dcx(dcx, sm)
|
||||
}
|
||||
|
||||
|
@ -269,9 +269,9 @@ impl ParseSess {
|
|||
let fallback_bundle = fallback_fluent_bundle(Vec::new(), false);
|
||||
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
|
||||
let emitter = Box::new(HumanEmitter::stderr(ColorConfig::Auto, fallback_bundle));
|
||||
let fatal_dcx = DiagCtxt::with_emitter(emitter);
|
||||
let dcx = DiagCtxt::with_emitter(Box::new(SilentEmitter { fatal_dcx, fatal_note }))
|
||||
.disable_warnings();
|
||||
let fatal_dcx = DiagCtxt::new(emitter);
|
||||
let dcx =
|
||||
DiagCtxt::new(Box::new(SilentEmitter { fatal_dcx, fatal_note })).disable_warnings();
|
||||
ParseSess::with_dcx(dcx, sm)
|
||||
}
|
||||
|
||||
|
|
|
@ -1080,8 +1080,8 @@ pub fn build_session(
|
|||
);
|
||||
let emitter = default_emitter(&sopts, registry, source_map.clone(), bundle, fallback_bundle);
|
||||
|
||||
let mut dcx = DiagCtxt::with_emitter(emitter)
|
||||
.with_flags(sopts.unstable_opts.dcx_flags(can_emit_warnings));
|
||||
let mut dcx =
|
||||
DiagCtxt::new(emitter).with_flags(sopts.unstable_opts.dcx_flags(can_emit_warnings));
|
||||
if let Some(ice_file) = ice_file {
|
||||
dcx = dcx.with_ice_file(ice_file);
|
||||
}
|
||||
|
@ -1402,7 +1402,7 @@ pub struct EarlyDiagCtxt {
|
|||
impl EarlyDiagCtxt {
|
||||
pub fn new(output: ErrorOutputType) -> Self {
|
||||
let emitter = mk_emitter(output);
|
||||
Self { dcx: DiagCtxt::with_emitter(emitter) }
|
||||
Self { dcx: DiagCtxt::new(emitter) }
|
||||
}
|
||||
|
||||
/// Swap out the underlying dcx once we acquire the user's preference on error emission
|
||||
|
@ -1412,7 +1412,7 @@ impl EarlyDiagCtxt {
|
|||
self.dcx.abort_if_errors();
|
||||
|
||||
let emitter = mk_emitter(output);
|
||||
self.dcx = DiagCtxt::with_emitter(emitter);
|
||||
self.dcx = DiagCtxt::new(emitter);
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue