summaryrefslogtreecommitdiffstats
path: root/vendor/proc-macro-hack/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/proc-macro-hack/src
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/proc-macro-hack/src')
-rw-r--r--vendor/proc-macro-hack/src/lib.rs20
-rw-r--r--vendor/proc-macro-hack/src/parse.rs8
2 files changed, 18 insertions, 10 deletions
diff --git a/vendor/proc-macro-hack/src/lib.rs b/vendor/proc-macro-hack/src/lib.rs
index 90b04fd5f..9a5a8ac43 100644
--- a/vendor/proc-macro-hack/src/lib.rs
+++ b/vendor/proc-macro-hack/src/lib.rs
@@ -2,7 +2,7 @@
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
-//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
//!
//! <br>
//!
@@ -145,7 +145,15 @@
//! [`proc-macro-nested`]: https://docs.rs/proc-macro-nested
#![recursion_limit = "512"]
-#![allow(clippy::needless_doctest_main, clippy::toplevel_ref_arg)]
+#![allow(
+ clippy::doc_markdown,
+ clippy::manual_strip,
+ clippy::module_name_repetitions,
+ clippy::needless_doctest_main,
+ clippy::needless_pass_by_value,
+ clippy::too_many_lines,
+ clippy::toplevel_ref_arg
+)]
extern crate proc_macro;
@@ -286,9 +294,9 @@ fn expand_export(export: Export, args: ExportArgs) -> TokenStream {
let mut export_call_site = TokenStream::new();
let mut macro_rules = TokenStream::new();
for Macro { name, export_as } in &export.macros {
- let hacked = hacked_proc_macro_name(&name);
- let dispatch = dispatch_macro_name(&name);
- let call_site = call_site_macro_name(&name);
+ let hacked = hacked_proc_macro_name(name);
+ let dispatch = dispatch_macro_name(name);
+ let call_site = call_site_macro_name(name);
if !actual_names.is_empty() {
actual_names.extend(quote!(,));
@@ -395,7 +403,7 @@ fn expand_export_nohack(export: Export) -> TokenStream {
let mut names = TokenStream::new();
for Macro { name, export_as } in &export.macros {
- let pub_name = pub_proc_macro_name(&name);
+ let pub_name = pub_proc_macro_name(name);
if !names.is_empty() {
names.extend(quote!(,));
}
diff --git a/vendor/proc-macro-hack/src/parse.rs b/vendor/proc-macro-hack/src/parse.rs
index fe074f166..f9c3b8029 100644
--- a/vendor/proc-macro-hack/src/parse.rs
+++ b/vendor/proc-macro-hack/src/parse.rs
@@ -5,7 +5,7 @@ use proc_macro::{Delimiter, Ident, Span, TokenStream, TokenTree};
pub(crate) fn parse_input(tokens: Iter) -> Result<Input, Error> {
let attrs = parse_attributes(tokens)?;
- let vis = parse_visibility(tokens)?;
+ let vis = parse_visibility(tokens);
let kw = parse_ident(tokens)?;
if kw.to_string() == "use" {
parse_export(attrs, vis, tokens).map(Input::Export)
@@ -136,16 +136,16 @@ fn parse_group(tokens: Iter, delimiter: Delimiter) -> Result<IterImpl, Error> {
}
}
-fn parse_visibility(tokens: Iter) -> Result<Visibility, Error> {
+fn parse_visibility(tokens: Iter) -> Visibility {
if let Some(TokenTree::Ident(ident)) = tokens.peek() {
if ident.to_string() == "pub" {
match tokens.next().unwrap() {
- TokenTree::Ident(vis) => return Ok(Some(vis)),
+ TokenTree::Ident(vis) => return Some(vis),
_ => unreachable!(),
}
}
}
- Ok(None)
+ None
}
fn parse_attributes(tokens: Iter) -> Result<TokenStream, Error> {