about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-03-30 09:45:36 +0100
committerDavid Wood <david.wood@huawei.com>2022-04-05 07:01:02 +0100
commit9956d4f99d021fa255d007dc17f23a3b0cd351e9 (patch)
treeca4296ee715ff51f04bbf3d728f14a6752f04e9f /compiler/rustc_errors/src/lib.rs
parent8677fef192a1d121b9123aa481422505833b57fe (diff)
downloadrust-9956d4f99d021fa255d007dc17f23a3b0cd351e9.tar.gz
rust-9956d4f99d021fa255d007dc17f23a3b0cd351e9.zip
macros: add args for non-subdiagnostic fields
Non-subdiagnostic fields (i.e. those that don't have `#[label]`
attributes or similar and are just additional context) have to be added
as arguments for Fluent messages to refer them. This commit extends the
`SessionDiagnostic` derive to do this for all fields that do not have
attributes and introduces an `IntoDiagnosticArg` trait that is
implemented on all types that can be converted to a argument for Fluent.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 5db6614c141..94db957d299 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -406,7 +406,8 @@ impl fmt::Display for ExplicitBug {
 impl error::Error for ExplicitBug {}
 
 pub use diagnostic::{
-    Diagnostic, DiagnosticArg, DiagnosticId, DiagnosticStyledString, SubDiagnostic,
+    Diagnostic, DiagnosticArg, DiagnosticArgValue, DiagnosticId, DiagnosticStyledString,
+    IntoDiagnosticArg, SubDiagnostic,
 };
 pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee};
 use std::backtrace::Backtrace;