diff options
| author | bors <bors@rust-lang.org> | 2024-03-11 00:34:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-11 00:34:44 +0000 |
| commit | cd81f5b27ee00b49d413db50b5e6af871cebcf23 (patch) | |
| tree | de825c76d6714c2be261ff363eb2c840c2484578 /compiler/rustc_const_eval/src | |
| parent | 76ee6fc926032c16a5706086922fc1125c061b70 (diff) | |
| parent | 43c06335cf2d1cc6b12fcfa5b8795d9becc52e8c (diff) | |
Auto merge of #122132 - nnethercote:diag-renaming3, r=nnethercote
Diagnostic renaming 3 A sequel to https://github.com/rust-lang/rust/pull/121780. r? `@davidtwco`
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/error.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 11 |
2 files changed, 12 insertions, 13 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index e5b4fc3a574..b6adee435ba 100644 --- a/compiler/rustc_const_eval/src/const_eval/error.rs +++ b/compiler/rustc_const_eval/src/const_eval/error.rs @@ -1,6 +1,6 @@ use std::mem; -use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, IntoDiagnostic, IntoDiagnosticArg}; +use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, Diagnostic, IntoDiagArg}; use rustc_hir::CRATE_HIR_ID; use rustc_middle::mir::AssertKind; use rustc_middle::query::TyCtxtAt; @@ -40,10 +40,10 @@ impl MachineStopType for ConstEvalErrKind { RecursiveStatic | ConstAccessesMutGlobal | ModifiedGlobal => {} AssertFailure(kind) => kind.add_args(adder), Panic { msg, line, col, file } => { - adder("msg".into(), msg.into_diagnostic_arg()); - adder("file".into(), file.into_diagnostic_arg()); - adder("line".into(), line.into_diagnostic_arg()); - adder("col".into(), col.into_diagnostic_arg()); + adder("msg".into(), msg.into_diag_arg()); + adder("file".into(), file.into_diag_arg()); + adder("line".into(), line.into_diag_arg()); + adder("col".into(), col.into_diag_arg()); } } } @@ -130,7 +130,7 @@ pub(super) fn report<'tcx, C, F, E>( where C: FnOnce() -> (Span, Vec<FrameNote>), F: FnOnce(Span, Vec<FrameNote>) -> E, - E: IntoDiagnostic<'tcx>, + E: Diagnostic<'tcx>, { // Special handling for certain errors match error { @@ -168,7 +168,7 @@ pub(super) fn lint<'tcx, 'mir, L>( lint: &'static rustc_session::lint::Lint, decorator: impl FnOnce(Vec<errors::FrameNote>) -> L, ) where - L: for<'a> rustc_errors::DecorateLint<'a, ()>, + L: for<'a> rustc_errors::LintDiagnostic<'a, ()>, { let (span, frames) = get_span_and_frames(tcx, machine); diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index afabd9689c6..249c02b75f7 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use rustc_errors::{ - codes::*, Diag, DiagArgValue, DiagCtxt, DiagMessage, EmissionGuarantee, IntoDiagnostic, Level, + codes::*, Diag, DiagArgValue, DiagCtxt, DiagMessage, Diagnostic, EmissionGuarantee, Level, }; use rustc_hir::ConstContext; use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; @@ -239,7 +239,7 @@ pub(crate) struct NonConstImplNote { pub span: Span, } -#[derive(Subdiagnostic, PartialEq, Eq, Clone)] +#[derive(Subdiagnostic, Clone)] #[note(const_eval_frame_note)] pub struct FrameNote { #[primary_span] @@ -858,8 +858,7 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> { InvalidProgramInfo::Layout(e) => { // The level doesn't matter, `dummy_diag` is consumed without it being used. let dummy_level = Level::Bug; - let dummy_diag: Diag<'_, ()> = - e.into_diagnostic().into_diagnostic(diag.dcx, dummy_level); + let dummy_diag: Diag<'_, ()> = e.into_diagnostic().into_diag(diag.dcx, dummy_level); for (name, val) in dummy_diag.args.iter() { diag.arg(name.clone(), val.clone()); } @@ -887,8 +886,8 @@ impl ReportErrorExt for ResourceExhaustionInfo { fn add_args<G: EmissionGuarantee>(self, _: &mut Diag<'_, G>) {} } -impl rustc_errors::IntoDiagnosticArg for InternKind { - fn into_diagnostic_arg(self) -> DiagArgValue { +impl rustc_errors::IntoDiagArg for InternKind { + fn into_diag_arg(self) -> DiagArgValue { DiagArgValue::Str(Cow::Borrowed(match self { InternKind::Static(Mutability::Not) => "static", InternKind::Static(Mutability::Mut) => "static_mut", |
