diff --git a/Cargo.toml b/Cargo.toml index 9dfab95a4e..d9d2c4e723 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,8 +35,8 @@ proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"] test = ["syn-test-suite/all-features"] [dependencies] -proc-macro2 = { version = "1.0.55", default-features = false } -quote = { version = "1.0.25", optional = true, default-features = false } +proc-macro2 = { version = "1.0.59", default-features = false } +quote = { version = "1.0.28", optional = true, default-features = false } unicode-ident = "1" [dev-dependencies] diff --git a/src/buffer.rs b/src/buffer.rs index e16f2adea8..3ff1d17128 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -5,10 +5,7 @@ // Syn, and caution should be used when editing it. The public-facing interface // is 100% safe but the implementation is fragile internally. -#[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "proc-macro" -))] +#[cfg(feature = "proc-macro")] use crate::proc_macro as pm; use crate::Lifetime; use proc_macro2::extra::DelimSpan; @@ -60,10 +57,7 @@ impl TokenBuffer { /// Creates a `TokenBuffer` containing all the tokens from the input /// `proc_macro::TokenStream`. - #[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "proc-macro" - ))] + #[cfg(feature = "proc-macro")] #[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))] pub fn new(stream: pm::TokenStream) -> Self { Self::new2(stream.into()) diff --git a/src/export.rs b/src/export.rs index c1c16f9ed1..5c06ebdd26 100644 --- a/src/export.rs +++ b/src/export.rs @@ -28,10 +28,7 @@ pub use crate::token::parsing::{peek_punct, punct as parse_punct}; #[cfg(feature = "printing")] pub use crate::token::printing::punct as print_punct; -#[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "proc-macro" -))] +#[cfg(feature = "proc-macro")] pub use proc_macro::TokenStream; #[cfg(feature = "printing")] diff --git a/src/lib.rs b/src/lib.rs index 91837a34f0..bfa4a4c2c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -296,10 +296,7 @@ clippy::wildcard_imports, )] -#[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "proc-macro" -))] +#[cfg(feature = "proc-macro")] extern crate proc_macro; #[macro_use] @@ -422,11 +419,7 @@ pub use crate::op::{BinOp, UnOp}; #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] pub mod parse; -#[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "parsing", - feature = "proc-macro" -))] +#[cfg(all(feature = "parsing", feature = "proc-macro"))] mod parse_macro_input; #[cfg(all(feature = "parsing", feature = "printing"))] @@ -860,11 +853,7 @@ pub mod __private; /// expanded.into() /// } /// ``` -#[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "parsing", - feature = "proc-macro" -))] +#[cfg(all(feature = "parsing", feature = "proc-macro"))] #[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "proc-macro"))))] pub fn parse(tokens: proc_macro::TokenStream) -> Result { parse::Parser::parse(T::parse, tokens) diff --git a/src/parse.rs b/src/parse.rs index 61a10d2bc4..5a2aeb628b 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -185,10 +185,7 @@ pub mod discouraged; use crate::buffer::{Cursor, TokenBuffer}; use crate::error; use crate::lookahead; -#[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "proc-macro" -))] +#[cfg(feature = "proc-macro")] use crate::proc_macro; use crate::punctuated::Punctuated; use crate::token::Token; @@ -1198,10 +1195,7 @@ pub trait Parser: Sized { /// /// This function will check that the input is fully parsed. If there are /// any unparsed tokens at the end of the stream, an error is returned. - #[cfg(all( - not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))), - feature = "proc-macro" - ))] + #[cfg(feature = "proc-macro")] #[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))] fn parse(self, tokens: proc_macro::TokenStream) -> Result { self.parse2(proc_macro2::TokenStream::from(tokens))