| 437 | } |
| 438 | |
| 439 | fn check_features(&mut self, other: &wasmparser::WasmFeatures) -> Result<()> { |
| 440 | let module_features = wasmparser::WasmFeatures::from_bits_truncate(self.features); |
| 441 | let missing_features = (*other & module_features) ^ module_features; |
| 442 | for (name, _) in missing_features.iter_names() { |
| 443 | let name = name.to_ascii_lowercase(); |
| 444 | bail!( |
| 445 | "Module was compiled with support for WebAssembly feature \ |
| 446 | `{name}` but it is not enabled for the host", |
| 447 | ); |
| 448 | } |
| 449 | Ok(()) |
| 450 | } |
| 451 | |
| 452 | fn check_collector( |
| 453 | module: Option<wasmtime_environ::Collector>, |