mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2025-03-02 20:36:24 +00:00
Merge pull request #689 from michaelvoronov/wasi
Add WASI target support
This commit is contained in:
commit
20fa9171ef
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
))]
|
||||
|
@ -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> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user