Rename IntoDiagnostic
as Diagnostic
.
To match `derive(Diagnostic)`. Also rename `into_diagnostic` as `into_diag`.
This commit is contained in:
parent
a09b1d33a7
commit
7a294e998b
28 changed files with 146 additions and 164 deletions
|
@ -38,7 +38,7 @@ extern crate self as rustc_errors;
|
|||
pub use codes::*;
|
||||
pub use diagnostic::{
|
||||
AddToDiagnostic, BugAbort, DecorateLint, Diag, DiagArg, DiagArgMap, DiagArgName, DiagArgValue,
|
||||
DiagInner, DiagStyledString, EmissionGuarantee, FatalAbort, IntoDiagArg, IntoDiagnostic,
|
||||
DiagInner, DiagStyledString, Diagnostic, EmissionGuarantee, FatalAbort, IntoDiagArg,
|
||||
StringPart, Subdiag, SubdiagMessageOp,
|
||||
};
|
||||
pub use diagnostic_impls::{
|
||||
|
@ -1134,12 +1134,12 @@ impl DiagCtxt {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn create_bug<'a>(&'a self, bug: impl IntoDiagnostic<'a, BugAbort>) -> Diag<'a, BugAbort> {
|
||||
bug.into_diagnostic(self, Bug)
|
||||
pub fn create_bug<'a>(&'a self, bug: impl Diagnostic<'a, BugAbort>) -> Diag<'a, BugAbort> {
|
||||
bug.into_diag(self, Bug)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn emit_bug<'a>(&'a self, bug: impl IntoDiagnostic<'a, BugAbort>) -> ! {
|
||||
pub fn emit_bug<'a>(&'a self, bug: impl Diagnostic<'a, BugAbort>) -> ! {
|
||||
self.create_bug(bug).emit()
|
||||
}
|
||||
|
||||
|
@ -1174,29 +1174,26 @@ impl DiagCtxt {
|
|||
#[track_caller]
|
||||
pub fn create_fatal<'a>(
|
||||
&'a self,
|
||||
fatal: impl IntoDiagnostic<'a, FatalAbort>,
|
||||
fatal: impl Diagnostic<'a, FatalAbort>,
|
||||
) -> Diag<'a, FatalAbort> {
|
||||
fatal.into_diagnostic(self, Fatal)
|
||||
fatal.into_diag(self, Fatal)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn emit_fatal<'a>(&'a self, fatal: impl IntoDiagnostic<'a, FatalAbort>) -> ! {
|
||||
pub fn emit_fatal<'a>(&'a self, fatal: impl Diagnostic<'a, FatalAbort>) -> ! {
|
||||
self.create_fatal(fatal).emit()
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn create_almost_fatal<'a>(
|
||||
&'a self,
|
||||
fatal: impl IntoDiagnostic<'a, FatalError>,
|
||||
fatal: impl Diagnostic<'a, FatalError>,
|
||||
) -> Diag<'a, FatalError> {
|
||||
fatal.into_diagnostic(self, Fatal)
|
||||
fatal.into_diag(self, Fatal)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn emit_almost_fatal<'a>(
|
||||
&'a self,
|
||||
fatal: impl IntoDiagnostic<'a, FatalError>,
|
||||
) -> FatalError {
|
||||
pub fn emit_almost_fatal<'a>(&'a self, fatal: impl Diagnostic<'a, FatalError>) -> FatalError {
|
||||
self.create_almost_fatal(fatal).emit()
|
||||
}
|
||||
|
||||
|
@ -1234,12 +1231,12 @@ impl DiagCtxt {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn create_err<'a>(&'a self, err: impl IntoDiagnostic<'a>) -> Diag<'a> {
|
||||
err.into_diagnostic(self, Error)
|
||||
pub fn create_err<'a>(&'a self, err: impl Diagnostic<'a>) -> Diag<'a> {
|
||||
err.into_diag(self, Error)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn emit_err<'a>(&'a self, err: impl IntoDiagnostic<'a>) -> ErrorGuaranteed {
|
||||
pub fn emit_err<'a>(&'a self, err: impl Diagnostic<'a>) -> ErrorGuaranteed {
|
||||
self.create_err(err).emit()
|
||||
}
|
||||
|
||||
|
@ -1297,12 +1294,12 @@ impl DiagCtxt {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn create_warn<'a>(&'a self, warning: impl IntoDiagnostic<'a, ()>) -> Diag<'a, ()> {
|
||||
warning.into_diagnostic(self, Warning)
|
||||
pub fn create_warn<'a>(&'a self, warning: impl Diagnostic<'a, ()>) -> Diag<'a, ()> {
|
||||
warning.into_diag(self, Warning)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn emit_warn<'a>(&'a self, warning: impl IntoDiagnostic<'a, ()>) {
|
||||
pub fn emit_warn<'a>(&'a self, warning: impl Diagnostic<'a, ()>) {
|
||||
self.create_warn(warning).emit()
|
||||
}
|
||||
|
||||
|
@ -1335,12 +1332,12 @@ impl DiagCtxt {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn create_note<'a>(&'a self, note: impl IntoDiagnostic<'a, ()>) -> Diag<'a, ()> {
|
||||
note.into_diagnostic(self, Note)
|
||||
pub fn create_note<'a>(&'a self, note: impl Diagnostic<'a, ()>) -> Diag<'a, ()> {
|
||||
note.into_diag(self, Note)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn emit_note<'a>(&'a self, note: impl IntoDiagnostic<'a, ()>) {
|
||||
pub fn emit_note<'a>(&'a self, note: impl Diagnostic<'a, ()>) {
|
||||
self.create_note(note).emit()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue