diff options
| author | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-06-22 00:12:13 +0800 |
|---|---|---|
| committer | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-06-25 21:07:16 +0800 |
| commit | d2d17c60bd62c03b91f6ded31b34da90addf2fc0 (patch) | |
| tree | 712bb199f9527c72eee0185f4ff98101132bebee /compiler/rustc_builtin_macros/src | |
| parent | 2fcf1776b9ccef89993dfe40e9f5c4908e2d2d48 (diff) | |
| download | rust-d2d17c60bd62c03b91f6ded31b34da90addf2fc0.tar.gz rust-d2d17c60bd62c03b91f6ded31b34da90addf2fc0.zip | |
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>
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/errors.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs index 3a2e96a5e5a..ec98fffb9c4 100644 --- a/compiler/rustc_builtin_macros/src/errors.rs +++ b/compiler/rustc_builtin_macros/src/errors.rs @@ -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); } } |
