Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with upstream #125

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 84 additions & 95 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ ahash = { version = "0.8.11", default-features = false }
termcolor = "1.2.0"
indoc = "2.0.5"
gimli = "0.30.0"
id-arena = "2"

wasm-compose = { version = "0.215.0", path = "crates/wasm-compose" }
wasm-encoder = { version = "0.215.0", path = "crates/wasm-encoder" }
Expand Down
21 changes: 21 additions & 0 deletions crates/wasmparser/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,27 @@ define_wasm_features! {
}
}

impl WasmFeatures {
/// Returns the feature set associated with the 1.0 version of the
/// WebAssembly specification or the "MVP" feature set.
pub fn wasm1() -> WasmFeatures {
WasmFeatures::FLOATS
}

/// Returns the feature set associated with the 2.0 version of the
/// WebAssembly specification.
pub fn wasm2() -> WasmFeatures {
WasmFeatures::wasm1()
| WasmFeatures::BULK_MEMORY
| WasmFeatures::REFERENCE_TYPES
| WasmFeatures::SIGN_EXTENSION
| WasmFeatures::MUTABLE_GLOBAL
| WasmFeatures::SATURATING_FLOAT_TO_INT
| WasmFeatures::MULTI_VALUE
| WasmFeatures::SIMD
}
}

impl From<WasmFeaturesInflated> for WasmFeatures {
#[inline]
fn from(inflated: WasmFeaturesInflated) -> Self {
Expand Down
5 changes: 4 additions & 1 deletion crates/wit-encoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version.workspace = true
workspace = true

[features]
default = ["serde"]
default = ["serde", "from-parser"]

# Enables JSON serialization/deserialization of the wit-encoder structures.

Expand All @@ -23,11 +23,14 @@ default = ["serde"]
# *Note*: The exact structure of the JSON is likely not going to be very stable over time,
# so slight tweaks and variants should be expected as this crate evolves.
serde = ["dep:serde", "semver/serde"]
from-parser = ["wit-parser", "id-arena"]

[dependencies]
semver = { workspace = true }
pretty_assertions = { workspace = true }
serde = { workspace = true, optional = true, features = ["derive"] }
wit-parser = { workspace = true, optional = true }
id-arena = { workspace = true, optional = true }

[dev-dependencies]
indoc = { workspace = true }
Loading