1
Fork 0

Rename SubDiagnostic as Subdiag.

Note the change of the `D` to `d`, to match all the other names that
have `Subdiag` in them, such as `SubdiagnosticMessage` and
`derive(Subdiagnostic)`.
This commit is contained in:
Nicholas Nethercote 2024-02-23 06:42:05 +11:00
parent 366536ba2b
commit 4e1f9bd528
6 changed files with 23 additions and 27 deletions

View file

@ -17,7 +17,7 @@ use crate::registry::Registry;
use crate::translation::{to_fluent_args, Translate};
use crate::{
diagnostic::IsLint, CodeSuggestion, FluentBundle, LazyFallbackBundle, MultiSpan, SpanLabel,
SubDiagnostic, TerminalUrl,
Subdiag, TerminalUrl,
};
use rustc_lint_defs::Applicability;
@ -431,16 +431,16 @@ impl Diagnostic {
}
fn from_sub_diagnostic(
diag: &SubDiagnostic,
subdiag: &Subdiag,
args: &FluentArgs<'_>,
je: &JsonEmitter,
) -> Diagnostic {
let translated_message = je.translate_messages(&diag.messages, args);
let translated_message = je.translate_messages(&subdiag.messages, args);
Diagnostic {
message: translated_message.to_string(),
code: None,
level: diag.level.to_str(),
spans: DiagnosticSpan::from_multispan(&diag.span, args, je),
level: subdiag.level.to_str(),
spans: DiagnosticSpan::from_multispan(&subdiag.span, args, je),
children: vec![],
rendered: None,
}