Add runtime check to avoid overwrite arg easily in diag and store and restore snapshot when set subdiag arg
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
@@ -672,6 +672,7 @@ impl Subdiagnostic for FormatUnusedArg {
|
||||
fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
|
||||
diag.arg("named", self.named);
|
||||
let msg = diag.eagerly_translate(crate::fluent_generated::builtin_macros_format_unused_arg);
|
||||
diag.remove_arg("named");
|
||||
diag.span_label(self.span, msg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user