about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/session_diagnostic.rs
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-03-31 08:50:45 +0100
committerDavid Wood <david.wood@huawei.com>2022-04-05 07:01:03 +0100
commit8100541d5496e087ca214df4e599a67a91f25983 (patch)
tree6e1f4d95a72ac54b0c98b32b5d448f2f39cdc3ac /compiler/rustc_macros/src/session_diagnostic.rs
parentd0fd8d78803eee2c9badde29811ba95b361aff88 (diff)
downloadrust-8100541d5496e087ca214df4e599a67a91f25983.tar.gz
rust-8100541d5496e087ca214df4e599a67a91f25983.zip
macros: rename `#[message]` to `#[primary_span]`
Small commit renaming `#[message]` to `#[primary_span]` as this more
accurately reflects what it does now.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_macros/src/session_diagnostic.rs')
-rw-r--r--compiler/rustc_macros/src/session_diagnostic.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_macros/src/session_diagnostic.rs b/compiler/rustc_macros/src/session_diagnostic.rs
index 05c013dcea7..73cd840f0eb 100644
--- a/compiler/rustc_macros/src/session_diagnostic.rs
+++ b/compiler/rustc_macros/src/session_diagnostic.rs
@@ -20,7 +20,7 @@ use std::collections::{BTreeSet, HashMap};
 /// pub struct MoveOutOfBorrowError<'tcx> {
 ///     pub name: Ident,
 ///     pub ty: Ty<'tcx>,
-///     #[message]
+///     #[primary_span]
 ///     #[label = "cannot move out of borrow"]
 ///     pub span: Span,
 ///     #[label = "`{ty}` first borrowed here"]
@@ -566,7 +566,7 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
         let meta = attr.parse_meta()?;
         match meta {
             syn::Meta::Path(_) => match name {
-                "message" => {
+                "primary_span" => {
                     if type_matches_path(&info.ty, &["rustc_span", "Span"]) {
                         return Ok(quote! {
                             #diag.set_span(*#field_binding);
@@ -574,7 +574,7 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
                     } else {
                         throw_span_err!(
                             attr.span().unwrap(),
-                            "the `#[message]` attribute can only be applied to fields of type `Span`"
+                            "the `#[primary_span]` attribute can only be applied to fields of type `Span`"
                         );
                     }
                 }