Auto merge of #100754 - davidtwco:translation-incremental, r=compiler-errors
incremental: migrate diagnostics - Apply the diagnostic migration lints to more functions on `Session`, namely: `span_warn`, `span_warn_with_code`, `warn` `note_without_error`, `span_note_without_error`, `struct_note_without_error`. - Add impls of `IntoDiagnosticArg` for `std::io::Error`, `std::path::Path` and `std::path::PathBuf`. - Migrate the `rustc_incremental` crate's diagnostics to translatable diagnostic structs. r? `@compiler-errors` cc #100717
This commit is contained in:
commit
a64ef7d07d
49 changed files with 1158 additions and 429 deletions
|
@ -187,6 +187,12 @@ impl Display for RegionName {
|
|||
}
|
||||
}
|
||||
|
||||
impl rustc_errors::IntoDiagnosticArg for RegionName {
|
||||
fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
|
||||
self.to_string().into_diagnostic_arg()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
||||
pub(crate) fn mir_def_id(&self) -> hir::def_id::LocalDefId {
|
||||
self.body.source.def_id().expect_local()
|
||||
|
|
|
@ -369,6 +369,8 @@ pub(super) fn dump_mir_results<'tcx>(
|
|||
};
|
||||
}
|
||||
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
pub(super) fn dump_annotation<'tcx>(
|
||||
infcx: &InferCtxt<'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use rustc_errors::{IntoDiagnosticArg, MultiSpan};
|
||||
use rustc_errors::MultiSpan;
|
||||
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
|
||||
use rustc_middle::ty::{GenericArg, Ty};
|
||||
use rustc_span::Span;
|
||||
|
@ -128,18 +128,6 @@ pub(crate) enum LifetimeReturnCategoryErr<'a> {
|
|||
},
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for &RegionName {
|
||||
fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
|
||||
format!("{}", self).into_diagnostic_arg()
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoDiagnosticArg for RegionName {
|
||||
fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
|
||||
format!("{}", self).into_diagnostic_arg()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub(crate) enum RequireStaticErr {
|
||||
#[note(borrowck_used_impl_require_static)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue