diff --git a/crates/wasmi/src/global.rs b/crates/wasmi/src/global.rs index 629f257257..8bc6aae683 100644 --- a/crates/wasmi/src/global.rs +++ b/crates/wasmi/src/global.rs @@ -34,13 +34,6 @@ pub enum GlobalError { /// The type of the new value that mismatches the type of the global variable. encountered: ValueType, }, - /// Occurs when a global type does not satisfy the constraints of another. - UnsatisfyingGlobalType { - /// The unsatisfying [`GlobalType`]. - unsatisfying: GlobalType, - /// The required [`GlobalType`]. - required: GlobalType, - }, } impl Display for GlobalError { @@ -57,16 +50,6 @@ impl Display for GlobalError { expected {expected:?} but encountered {encountered:?}.", ) } - Self::UnsatisfyingGlobalType { - unsatisfying, - required, - } => { - write!( - f, - "global type {unsatisfying:?} does not \ - satisfy requirements of {required:?}", - ) - } } } } @@ -119,22 +102,6 @@ impl GlobalType { pub fn mutability(&self) -> Mutability { self.mutability } - - /// Checks if `self` satisfies the given `GlobalType`. - /// - /// # Errors - /// - /// - If the initial limits of the `required` [`GlobalType`] are greater than `self`. - /// - If the maximum limits of the `required` [`GlobalType`] are greater than `self`. - pub(crate) fn satisfies(&self, required: &GlobalType) -> Result<(), GlobalError> { - if self != required { - return Err(GlobalError::UnsatisfyingGlobalType { - unsatisfying: *self, - required: *required, - }); - } - Ok(()) - } } /// A global variable entity. diff --git a/crates/wasmi/src/module/instantiate/mod.rs b/crates/wasmi/src/module/instantiate/mod.rs index 193a531cf3..15552dcd35 100644 --- a/crates/wasmi/src/module/instantiate/mod.rs +++ b/crates/wasmi/src/module/instantiate/mod.rs @@ -91,19 +91,16 @@ impl Module { /// mismatch with the expected module import type. /// /// [`Func`]: [`crate::Func`] - fn extract_imports( - builder: &mut InstanceEntityBuilder, - externals: I, - ) + fn extract_imports(builder: &mut InstanceEntityBuilder, externals: I) where I: IntoIterator, { for external in externals { match external { - Extern::Func(func)=> { + Extern::Func(func) => { builder.push_func(func); } - Extern::Table(table)=> { + Extern::Table(table) => { builder.push_table(table); } Extern::Memory(memory) => {