Skip to content

Commit 5130ca9

Browse files
authored
Merge pull request #111 from lukaslueg/wasm
Ignore proc-macro feature on wasm-target
2 parents 6f3be41 + c8e4ab5 commit 5130ca9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#![doc(html_root_url = "https://docs.rs/proc-macro2/0.4.9")]
4747
#![cfg_attr(feature = "nightly", feature(proc_macro_raw_ident, proc_macro_span))]
4848

49-
#[cfg(feature = "proc-macro")]
49+
#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
5050
extern crate proc_macro;
5151
extern crate unicode_xid;
5252

@@ -146,14 +146,14 @@ impl FromStr for TokenStream {
146146
}
147147
}
148148

149-
#[cfg(feature = "proc-macro")]
149+
#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
150150
impl From<proc_macro::TokenStream> for TokenStream {
151151
fn from(inner: proc_macro::TokenStream) -> TokenStream {
152152
TokenStream::_new(inner.into())
153153
}
154154
}
155155

156-
#[cfg(feature = "proc-macro")]
156+
#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
157157
impl From<TokenStream> for proc_macro::TokenStream {
158158
fn from(inner: TokenStream) -> proc_macro::TokenStream {
159159
inner.inner.into()
@@ -318,7 +318,7 @@ impl Span {
318318
}
319319

320320
/// This method is only available when the `"nightly"` feature is enabled.
321-
#[cfg(all(feature = "nightly", feature = "proc-macro"))]
321+
#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "nightly", feature = "proc-macro"))]
322322
pub fn unstable(self) -> proc_macro::Span {
323323
self.inner.unstable()
324324
}

src/stable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl fmt::Debug for TokenStream {
116116
}
117117
}
118118

119-
#[cfg(feature = "proc-macro")]
119+
#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
120120
impl From<::proc_macro::TokenStream> for TokenStream {
121121
fn from(inner: ::proc_macro::TokenStream) -> TokenStream {
122122
inner
@@ -126,7 +126,7 @@ impl From<::proc_macro::TokenStream> for TokenStream {
126126
}
127127
}
128128

129-
#[cfg(feature = "proc-macro")]
129+
#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
130130
impl From<TokenStream> for ::proc_macro::TokenStream {
131131
fn from(inner: TokenStream) -> ::proc_macro::TokenStream {
132132
inner

0 commit comments

Comments
 (0)