Merge pull request #689 from michaelvoronov/wasi

Add WASI target support
This commit is contained in:
David Tolnay 2019-08-10 11:32:15 -07:00 committed by GitHub
commit 20fa9171ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 8 deletions

View File

@ -63,6 +63,11 @@ matrix:
env: TARGET=wasm32-unknown-unknown
install:
- rustup target add "${TARGET}"
- rust: nightly
name: WASI
env: TARGET=wasm32-wasi
install:
- rustup target add "${TARGET}"
allow_failures:
- rust: nightly
name: Clippy

View File

@ -8,7 +8,7 @@
// is 100% safe but the implementation is fragile internally.
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "proc-macro"
))]
use crate::proc_macro as pm;
@ -101,7 +101,7 @@ impl TokenBuffer {
/// *This method is available if Syn is built with both the `"parsing"` and
/// `"proc-macro"` features.*
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "proc-macro"
))]
pub fn new(stream: pm::TokenStream) -> TokenBuffer {

View File

@ -16,7 +16,7 @@ pub use proc_macro2::{Span, TokenStream as TokenStream2};
pub use crate::span::IntoSpans;
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "proc-macro"
))]
pub use proc_macro::TokenStream;

View File

@ -267,7 +267,7 @@
)]
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "proc-macro"
))]
extern crate proc_macro;
@ -415,7 +415,7 @@ pub mod parse_quote;
// Not public API except the `parse_macro_input!` macro.
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "parsing",
feature = "proc-macro"
))]
@ -616,7 +616,7 @@ pub use crate::error::{Error, Result};
/// }
/// ```
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "parsing",
feature = "proc-macro"
))]

View File

@ -200,7 +200,7 @@ use std::rc::Rc;
use std::str::FromStr;
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "proc-macro"
))]
use crate::proc_macro;
@ -1066,7 +1066,7 @@ pub trait Parser: Sized {
/// *This method is available if Syn is built with both the `"parsing"` and
/// `"proc-macro"` features.*
#[cfg(all(
not(all(target_arch = "wasm32", target_os = "unknown")),
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
feature = "proc-macro"
))]
fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output> {