about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/diagnostics/mod.rs
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-06-23 14:51:44 +0100
committerDavid Wood <david.wood@huawei.com>2022-06-24 09:08:25 +0100
commit99bc97940314176bc6ed38cea11723cc1fd9ee3b (patch)
tree26bc8329607a52e1ba23732424c0673844b29012 /compiler/rustc_macros/src/diagnostics/mod.rs
parentfc96600bf6a52f92aeeee60a92a161a82b61c0ef (diff)
downloadrust-99bc97940314176bc6ed38cea11723cc1fd9ee3b.tar.gz
rust-99bc97940314176bc6ed38cea11723cc1fd9ee3b.zip
macros: use typed identifiers in diag derive
Using typed identifiers instead of strings with the Fluent identifier
enables the diagnostic derive to benefit from the compile-time
validation that comes with typed identifiers - use of a non-existent
Fluent identifier will not compile.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/mod.rs')
-rw-r--r--compiler/rustc_macros/src/diagnostics/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/mod.rs b/compiler/rustc_macros/src/diagnostics/mod.rs
index 69573d904d4..88182ed5a12 100644
--- a/compiler/rustc_macros/src/diagnostics/mod.rs
+++ b/compiler/rustc_macros/src/diagnostics/mod.rs
@@ -22,14 +22,14 @@ use synstructure::Structure;
 /// # extern crate rust_middle;
 /// # use rustc_middle::ty::Ty;
 /// #[derive(SessionDiagnostic)]
-/// #[error(code = "E0505", slug = "borrowck-move-out-of-borrow")]
+/// #[error(borrowck::move_out_of_borrow, code = "E0505")]
 /// pub struct MoveOutOfBorrowError<'tcx> {
 ///     pub name: Ident,
 ///     pub ty: Ty<'tcx>,
 ///     #[primary_span]
 ///     #[label]
 ///     pub span: Span,
-///     #[label = "first-borrow-label"]
+///     #[label(borrowck::first_borrow_label)]
 ///     pub first_borrow_span: Span,
 ///     #[suggestion(code = "{name}.clone()")]
 ///     pub clone_sugg: Option<(Span, Applicability)>