mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2025-03-03 04:46:22 +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
|
env: TARGET=wasm32-unknown-unknown
|
||||||
install:
|
install:
|
||||||
- rustup target add "${TARGET}"
|
- rustup target add "${TARGET}"
|
||||||
|
- rust: nightly
|
||||||
|
name: WASI
|
||||||
|
env: TARGET=wasm32-wasi
|
||||||
|
install:
|
||||||
|
- rustup target add "${TARGET}"
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
name: Clippy
|
name: Clippy
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// is 100% safe but the implementation is fragile internally.
|
// is 100% safe but the implementation is fragile internally.
|
||||||
|
|
||||||
#[cfg(all(
|
#[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"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
use crate::proc_macro as pm;
|
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
|
/// *This method is available if Syn is built with both the `"parsing"` and
|
||||||
/// `"proc-macro"` features.*
|
/// `"proc-macro"` features.*
|
||||||
#[cfg(all(
|
#[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"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
pub fn new(stream: pm::TokenStream) -> TokenBuffer {
|
pub fn new(stream: pm::TokenStream) -> TokenBuffer {
|
||||||
|
@ -16,7 +16,7 @@ pub use proc_macro2::{Span, TokenStream as TokenStream2};
|
|||||||
pub use crate::span::IntoSpans;
|
pub use crate::span::IntoSpans;
|
||||||
|
|
||||||
#[cfg(all(
|
#[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"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
pub use proc_macro::TokenStream;
|
pub use proc_macro::TokenStream;
|
||||||
|
@ -267,7 +267,7 @@
|
|||||||
)]
|
)]
|
||||||
|
|
||||||
#[cfg(all(
|
#[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"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
@ -415,7 +415,7 @@ pub mod parse_quote;
|
|||||||
|
|
||||||
// Not public API except the `parse_macro_input!` macro.
|
// Not public API except the `parse_macro_input!` macro.
|
||||||
#[cfg(all(
|
#[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 = "parsing",
|
||||||
feature = "proc-macro"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
@ -616,7 +616,7 @@ pub use crate::error::{Error, Result};
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(all(
|
#[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 = "parsing",
|
||||||
feature = "proc-macro"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
|
@ -200,7 +200,7 @@ use std::rc::Rc;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[cfg(all(
|
#[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"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
use crate::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
|
/// *This method is available if Syn is built with both the `"parsing"` and
|
||||||
/// `"proc-macro"` features.*
|
/// `"proc-macro"` features.*
|
||||||
#[cfg(all(
|
#[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"
|
feature = "proc-macro"
|
||||||
))]
|
))]
|
||||||
fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output> {
|
fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user