diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/json/tests.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_expand/src/tests.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 8 |
7 files changed, 13 insertions, 13 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index c784ee48675..97089dff31b 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -373,7 +373,7 @@ pub struct CodegenContext<B: WriteBackendMethods> { impl<B: WriteBackendMethods> CodegenContext<B> { pub fn create_dcx(&self) -> DiagCtxt { - DiagCtxt::with_emitter(Box::new(self.diag_emitter.clone())) + DiagCtxt::new(Box::new(self.diag_emitter.clone())) } pub fn config(&self, kind: ModuleKind) -> &ModuleConfig { diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 692c059beb0..10188026a97 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -1388,7 +1388,7 @@ fn report_ice( rustc_errors::ColorConfig::Auto, fallback_bundle, )); - let dcx = rustc_errors::DiagCtxt::with_emitter(emitter); + let dcx = rustc_errors::DiagCtxt::new(emitter); // a .span_bug or .bug call has already printed what // it wants to print. diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs index 303de0a93f6..ba8d58e159e 100644 --- a/compiler/rustc_errors/src/json/tests.rs +++ b/compiler/rustc_errors/src/json/tests.rs @@ -61,7 +61,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { ); let span = Span::with_root_ctxt(BytePos(span.0), BytePos(span.1)); - let dcx = DiagCtxt::with_emitter(Box::new(je)); + let dcx = DiagCtxt::new(Box::new(je)); dcx.span_err(span, "foo"); let bytes = output.lock().unwrap(); diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 72b3c88ee03..a5e6aed13eb 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -601,7 +601,7 @@ impl DiagCtxt { self } - pub fn with_emitter(emitter: Box<DynEmitter>) -> Self { + pub fn new(emitter: Box<DynEmitter>) -> Self { Self { inner: Lock::new(DiagCtxtInner { flags: DiagCtxtFlags { can_emit_warnings: true, ..Default::default() }, diff --git a/compiler/rustc_expand/src/tests.rs b/compiler/rustc_expand/src/tests.rs index 3c14ad5e7b8..b242ce795fd 100644 --- a/compiler/rustc_expand/src/tests.rs +++ b/compiler/rustc_expand/src/tests.rs @@ -33,7 +33,7 @@ fn create_test_handler() -> (DiagCtxt, Lrc<SourceMap>, Arc<Mutex<Vec<u8>>>) { let emitter = HumanEmitter::new(Box::new(Shared { data: output.clone() }), fallback_bundle) .sm(Some(source_map.clone())) .diagnostic_width(Some(140)); - let dcx = DiagCtxt::with_emitter(Box::new(emitter)); + let dcx = DiagCtxt::new(Box::new(emitter)); (dcx, source_map, output) } diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index c88a1186965..5e8acf693dd 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -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) } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index e9db96dc356..aa45958c07b 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -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)] |
