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.)
This commit is contained in:
@@ -519,7 +519,7 @@ impl Emitter for HumanEmitter {
|
||||
}
|
||||
|
||||
fn emit_diagnostic(&mut self, mut diag: Diagnostic) {
|
||||
let fluent_args = to_fluent_args(diag.args());
|
||||
let fluent_args = to_fluent_args(diag.args.iter());
|
||||
|
||||
let mut suggestions = diag.suggestions.unwrap_or(vec![]);
|
||||
self.primary_span_formatted(&mut diag.span, &mut suggestions, &fluent_args);
|
||||
|
||||
Reference in New Issue
Block a user