about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/diagnostics
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-05-07 07:26:03 +0100
committerDavid Wood <david.wood@huawei.com>2022-05-12 07:21:51 +0100
commitde3e8ca2f3908dc48fddb0d5b4c14c776017b43e (patch)
tree73536ec335942051c8bf762c654f0fcf224dcfd8 /compiler/rustc_macros/src/diagnostics
parentb5545f1b0c28a7acba27d1985a934845a013af1b (diff)
downloadrust-de3e8ca2f3908dc48fddb0d5b4c14c776017b43e.tar.gz
rust-de3e8ca2f3908dc48fddb0d5b4c14c776017b43e.zip
errors: `set_arg` takes `IntoDiagnosticArg`
Manual implementors of translatable diagnostics will need to call
`set_arg`, not just the derive, so make this function a bit more
ergonomic by taking `IntoDiagnosticArg` rather than
`DiagnosticArgValue`.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics')
-rw-r--r--compiler/rustc_macros/src/diagnostics/diagnostic.rs2
-rw-r--r--compiler/rustc_macros/src/diagnostics/subdiagnostic.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs
index 6788ce37eae..dac3e986e7a 100644
--- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs
+++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs
@@ -113,7 +113,7 @@ impl<'a> SessionDiagnosticDerive<'a> {
                         quote! {
                             #diag.set_arg(
                                 stringify!(#ident),
-                                #field_binding.into_diagnostic_arg()
+                                #field_binding
                             );
                         }
                     } else {
diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
index 65b1328682f..ae5b9dbd9ba 100644
--- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
+++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
@@ -349,7 +349,7 @@ impl<'a> SessionSubdiagnosticDeriveBuilder<'a> {
         let generated = quote! {
             #diag.set_arg(
                 stringify!(#ident),
-                #binding.into_diagnostic_arg()
+                #binding
             );
         };