about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/json.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-16 06:07:49 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-22 12:51:05 +1100
commitb38ed1afa6cae65e5895f419ab8af98bdf5af840 (patch)
tree366bdab311fc7b656ce052d36e63f198510b55cd /compiler/rustc_errors/src/json.rs
parentf8131a48a46ac3bc8a3d0fe0477055b132cffdc3 (diff)
downloadrust-b38ed1afa6cae65e5895f419ab8af98bdf5af840.tar.gz
rust-b38ed1afa6cae65e5895f419ab8af98bdf5af840.zip
Overhaul `Diagnostic` args.
First, introduce a typedef `DiagnosticArgMap`.

Second, make the `args` field public, and remove the `args` getter and
`replace_args` setter. These were necessary previously because the getter
had a `#[allow(rustc::potential_query_instability)]` attribute, but that
was removed in #120931 when the args were changed from `FxHashMap` to
`FxIndexMap`. (All the other `Diagnostic` fields are public.)
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
-rw-r--r--compiler/rustc_errors/src/json.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index 470e3d52452..e57b414c52d 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -341,7 +341,7 @@ struct UnusedExterns<'a, 'b, 'c> {
 
 impl Diagnostic {
     fn from_errors_diagnostic(diag: crate::Diagnostic, je: &JsonEmitter) -> Diagnostic {
-        let args = to_fluent_args(diag.args());
+        let args = to_fluent_args(diag.args.iter());
         let sugg = diag.suggestions.iter().flatten().map(|sugg| {
             let translated_message =
                 je.translate_message(&sugg.msg, &args).map_err(Report::new).unwrap();