Implement PartialEq on FuncType.

This commit is contained in:
Peter Huene
2020-02-25 13:01:54 -08:00
parent 104919eb79
commit 07066835db
2 changed files with 2 additions and 6 deletions

View File

@@ -168,7 +168,7 @@ fn from_wasmtime_abiparam(param: &ir::AbiParam) -> Option<ValType> {
/// A descriptor for a function in a WebAssembly module.
///
/// WebAssembly functions can have 0 or more parameters and results.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub struct FuncType {
params: Box<[ValType]>,
results: Box<[ValType]>,

View File

@@ -244,11 +244,7 @@ pub unsafe extern "C" fn wasi_instance_bind_import(
match (*instance).wasi.get_export(name) {
Some(export) => {
if export.ty().params() != func_type.params() {
return std::ptr::null_mut();
}
if export.ty().results() != func_type.results() {
if export.ty() != func_type {
return std::ptr::null_mut();
}