Skip to content

Commit dab9dc8

Browse files
authored
Remove feature validation from Wasmtime (#9623)
Some of this originated in #917 but nowadays it shouldn't be necessary to control proposals like this. Instead it's probably best nowadays to throw configuration at `wasmparser` and use its definition of features to determine whether constructs make sense or not. This reduces the amount of bits and pieces Wasmtime has to do and avoids interactions such as #9622. Closes #9622
1 parent 925a4f4 commit dab9dc8

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

crates/wasmtime/src/config.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,25 +2016,6 @@ impl Config {
20162016
panic!("should have returned an error by now")
20172017
}
20182018

2019-
if features.contains(WasmFeatures::REFERENCE_TYPES)
2020-
&& !features.contains(WasmFeatures::BULK_MEMORY)
2021-
{
2022-
bail!("feature 'reference_types' requires 'bulk_memory' to be enabled");
2023-
}
2024-
if features.contains(WasmFeatures::THREADS) && !features.contains(WasmFeatures::BULK_MEMORY)
2025-
{
2026-
bail!("feature 'threads' requires 'bulk_memory' to be enabled");
2027-
}
2028-
if features.contains(WasmFeatures::FUNCTION_REFERENCES)
2029-
&& !features.contains(WasmFeatures::REFERENCE_TYPES)
2030-
{
2031-
bail!("feature 'function_references' requires 'reference_types' to be enabled");
2032-
}
2033-
if features.contains(WasmFeatures::GC)
2034-
&& !features.contains(WasmFeatures::FUNCTION_REFERENCES)
2035-
{
2036-
bail!("feature 'gc' requires 'function_references' to be enabled");
2037-
}
20382019
#[cfg(feature = "async")]
20392020
if self.async_support && self.max_wasm_stack > self.async_stack_size {
20402021
bail!("max_wasm_stack size cannot exceed the async_stack_size");

0 commit comments

Comments
 (0)