1
Fork 0

Rename IntoDiagnostic as Diagnostic.

To match `derive(Diagnostic)`.

Also rename `into_diagnostic` as `into_diag`.
This commit is contained in:
Nicholas Nethercote 2024-03-06 11:02:56 +11:00
parent a09b1d33a7
commit 7a294e998b
28 changed files with 146 additions and 164 deletions

View file

@ -1,6 +1,6 @@
//! Errors emitted by symbol_mangling.
use rustc_errors::{Diag, DiagCtxt, EmissionGuarantee, IntoDiagnostic, Level};
use rustc_errors::{Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
use rustc_span::Span;
use std::fmt;
@ -13,8 +13,8 @@ pub struct TestOutput {
// This diagnostic doesn't need translation because (a) it doesn't contain any
// natural language, and (b) it's only used in tests. So we construct it
// manually and avoid the fluent machinery.
impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for TestOutput {
fn into_diagnostic(self, dcx: &'_ DiagCtxt, level: Level) -> Diag<'_, G> {
impl<G: EmissionGuarantee> Diagnostic<'_, G> for TestOutput {
fn into_diag(self, dcx: &'_ DiagCtxt, level: Level) -> Diag<'_, G> {
let TestOutput { span, kind, content } = self;
#[allow(rustc::untranslatable_diagnostic)]