Add a useful comment.

It took me a while to work this out.
This commit is contained in:
Nicholas Nethercote 2024-02-29 16:15:44 +11:00
parent 9ff4487999
commit 58f45059a5

View File

@ -279,6 +279,7 @@ struct UnusedExterns<'a> {
} }
impl Diagnostic { impl Diagnostic {
/// Converts from `rustc_errors::DiagInner` to `Diagnostic`.
fn from_errors_diagnostic(diag: crate::DiagInner, je: &JsonEmitter) -> Diagnostic { fn from_errors_diagnostic(diag: crate::DiagInner, je: &JsonEmitter) -> Diagnostic {
let args = to_fluent_args(diag.args.iter()); let args = to_fluent_args(diag.args.iter());
let sugg = diag.suggestions.iter().flatten().map(|sugg| { let sugg = diag.suggestions.iter().flatten().map(|sugg| {