diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /compiler/rustc_macros/src/diagnostics/error.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/error.rs')
-rw-r--r-- | compiler/rustc_macros/src/diagnostics/error.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/error.rs b/compiler/rustc_macros/src/diagnostics/error.rs index 4612f54e4..2d62d5931 100644 --- a/compiler/rustc_macros/src/diagnostics/error.rs +++ b/compiler/rustc_macros/src/diagnostics/error.rs @@ -76,11 +76,11 @@ pub(crate) fn invalid_attr(attr: &Attribute, meta: &Meta) -> Diagnostic { let span = attr.span().unwrap(); let path = path_to_string(&attr.path); match meta { - Meta::Path(_) => span_err(span, &format!("`#[{}]` is not a valid attribute", path)), + Meta::Path(_) => span_err(span, &format!("`#[{path}]` is not a valid attribute")), Meta::NameValue(_) => { - span_err(span, &format!("`#[{} = ...]` is not a valid attribute", path)) + span_err(span, &format!("`#[{path} = ...]` is not a valid attribute")) } - Meta::List(_) => span_err(span, &format!("`#[{}(...)]` is not a valid attribute", path)), + Meta::List(_) => span_err(span, &format!("`#[{path}(...)]` is not a valid attribute")), } } @@ -107,7 +107,7 @@ pub(crate) fn invalid_nested_attr(attr: &Attribute, nested: &NestedMeta) -> Diag let meta = match nested { syn::NestedMeta::Meta(meta) => meta, syn::NestedMeta::Lit(_) => { - return span_err(span, &format!("`#[{}(\"...\")]` is not a valid attribute", name)); + return span_err(span, &format!("`#[{name}(\"...\")]` is not a valid attribute")); } }; @@ -115,13 +115,11 @@ pub(crate) fn invalid_nested_attr(attr: &Attribute, nested: &NestedMeta) -> Diag let path = path_to_string(meta.path()); match meta { Meta::NameValue(..) => { - span_err(span, &format!("`#[{}({} = ...)]` is not a valid attribute", name, path)) - } - Meta::Path(..) => { - span_err(span, &format!("`#[{}({})]` is not a valid attribute", name, path)) + span_err(span, &format!("`#[{name}({path} = ...)]` is not a valid attribute")) } + Meta::Path(..) => span_err(span, &format!("`#[{name}({path})]` is not a valid attribute")), Meta::List(..) => { - span_err(span, &format!("`#[{}({}(...))]` is not a valid attribute", name, path)) + span_err(span, &format!("`#[{name}({path}(...))]` is not a valid attribute")) } } } |