diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 06:21:26 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 16:06:21 +1100 |
| commit | 09af8a667c0fa456bbe62fa462f4b0f42f2845ec (patch) | |
| tree | 529aace2e7aef269509df93408bb13d189a575bf /compiler/rustc_const_eval/src | |
| parent | 9df1576e1d477cfbfb4f39e779ce48552f9c28da (diff) | |
| download | rust-09af8a667c0fa456bbe62fa462f4b0f42f2845ec.tar.gz rust-09af8a667c0fa456bbe62fa462f4b0f42f2845ec.zip | |
Rename `Session::span_diagnostic` as `Session::dcx`.
Diffstat (limited to 'compiler/rustc_const_eval/src')
5 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index 26cf3b3f2b0..8f18cd78d3f 100644 --- a/compiler/rustc_const_eval/src/const_eval/error.rs +++ b/compiler/rustc_const_eval/src/const_eval/error.rs @@ -154,7 +154,7 @@ where let mut err = tcx.sess.create_err(err); let msg = error.diagnostic_message(); - error.add_args(tcx.sess.diagnostic(), &mut err); + error.add_args(tcx.sess.dcx(), &mut err); // Use *our* span to label the interp error err.span_label(our_span, msg); diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index 5275c0ff14c..f52d5f12318 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -444,7 +444,7 @@ pub trait ReportErrorExt { { ty::tls::with(move |tcx| { let mut builder = tcx.sess.struct_allow(DiagnosticMessage::Str(String::new().into())); - let handler = tcx.sess.diagnostic(); + let handler = tcx.sess.dcx(); let message = self.diagnostic_message(); self.add_args(handler, &mut builder); let s = handler.eagerly_translate_to_string(message, builder.args()); diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 847d6503f20..2cce007898d 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -473,7 +473,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { backtrace.print_backtrace(); // FIXME(fee1-dead), HACK: we want to use the error as title therefore we can just extract the // label and arguments from the InterpError. - let handler = self.tcx.sess.diagnostic(); + let handler = self.tcx.sess.dcx(); #[allow(rustc::untranslatable_diagnostic)] let mut diag = self.tcx.sess.struct_allow(""); let msg = e.diagnostic_message(); diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index bb17602d3ba..949606ed6c9 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -278,7 +278,7 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> { let secondary_errors = mem::take(&mut self.secondary_errors); if self.error_emitted.is_none() { for error in secondary_errors { - self.tcx.sess.diagnostic().emit_diagnostic(error); + self.tcx.sess.dcx().emit_diagnostic(error); } } else { assert!(self.tcx.sess.has_errors().is_some()); diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs index eaf4abf39b7..cca5b90abb9 100644 --- a/compiler/rustc_const_eval/src/transform/validate.rs +++ b/compiler/rustc_const_eval/src/transform/validate.rs @@ -130,7 +130,7 @@ impl<'a, 'tcx> CfgChecker<'a, 'tcx> { let span = self.body.source_info(location).span; // We use `span_delayed_bug` as we might see broken MIR when other errors have already // occurred. - self.tcx.sess.diagnostic().span_delayed_bug( + self.tcx.sess.dcx().span_delayed_bug( span, format!( "broken MIR in {:?} ({}) at {:?}:\n{}", @@ -571,7 +571,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> { fn visit_source_scope(&mut self, scope: SourceScope) { if self.body.source_scopes.get(scope).is_none() { - self.tcx.sess.diagnostic().span_delayed_bug( + self.tcx.sess.dcx().span_delayed_bug( self.body.span, format!( "broken MIR in {:?} ({}):\ninvalid source scope {:?}", |
