Implement PartialEq on FuncType.
This commit is contained in:
@@ -168,7 +168,7 @@ fn from_wasmtime_abiparam(param: &ir::AbiParam) -> Option<ValType> {
|
|||||||
/// A descriptor for a function in a WebAssembly module.
|
/// A descriptor for a function in a WebAssembly module.
|
||||||
///
|
///
|
||||||
/// WebAssembly functions can have 0 or more parameters and results.
|
/// WebAssembly functions can have 0 or more parameters and results.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct FuncType {
|
pub struct FuncType {
|
||||||
params: Box<[ValType]>,
|
params: Box<[ValType]>,
|
||||||
results: Box<[ValType]>,
|
results: Box<[ValType]>,
|
||||||
|
|||||||
@@ -244,11 +244,7 @@ pub unsafe extern "C" fn wasi_instance_bind_import(
|
|||||||
|
|
||||||
match (*instance).wasi.get_export(name) {
|
match (*instance).wasi.get_export(name) {
|
||||||
Some(export) => {
|
Some(export) => {
|
||||||
if export.ty().params() != func_type.params() {
|
if export.ty() != func_type {
|
||||||
return std::ptr::null_mut();
|
|
||||||
}
|
|
||||||
|
|
||||||
if export.ty().results() != func_type.results() {
|
|
||||||
return std::ptr::null_mut();
|
return std::ptr::null_mut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user