diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-06 11:02:56 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-11 09:15:09 +1100 |
| commit | 7a294e998b66ea6d410a6840cba80347fc4764c2 (patch) | |
| tree | aa7a68bfbbb9177a06cda144baca657f4939996b /compiler/rustc_const_eval/src | |
| parent | a09b1d33a703d4ed412e70d3197e73ba7e0937f9 (diff) | |
| download | rust-7a294e998b66ea6d410a6840cba80347fc4764c2.tar.gz rust-7a294e998b66ea6d410a6840cba80347fc4764c2.zip | |
Rename `IntoDiagnostic` as `Diagnostic`.
To match `derive(Diagnostic)`. Also rename `into_diagnostic` as `into_diag`.
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/error.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs index 924f64160e5..4b1664b8156 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, IntoDiagArg, IntoDiagnostic}; +use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, Diagnostic, IntoDiagArg}; use rustc_hir::CRATE_HIR_ID; use rustc_middle::mir::AssertKind; use rustc_middle::query::TyCtxtAt; @@ -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 { diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index 9753ac95ab1..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}; @@ -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()); } |
