This commit is contained in:
losfair 2019-03-19 20:01:38 +08:00
parent 61abe70042
commit a006a368c5
3 changed files with 1 additions and 25 deletions

View File

@ -5,7 +5,6 @@ use crate::types::{
use core::borrow::Borrow;
use std::any::Any;
use std::sync::Arc;
use wasmparser::BinaryReaderError;
pub type Result<T> = std::result::Result<T, Error>;
pub type CompileResult<T> = std::result::Result<T, CompileError>;
@ -25,14 +24,6 @@ pub enum CompileError {
InternalError { msg: String },
}
impl From<BinaryReaderError> for CompileError {
fn from(other: BinaryReaderError) -> CompileError {
CompileError::InternalError {
msg: format!("{:?}", other),
}
}
}
impl PartialEq for CompileError {
fn eq(&self, _other: &CompileError) -> bool {
false

View File

@ -18,21 +18,6 @@ pub enum Type {
F64,
}
impl Type {
pub fn from_wasmparser_type(other: ::wasmparser::Type) -> CompileResult<Type> {
use wasmparser::Type as WPType;
match other {
WPType::I32 => Ok(Type::I32),
WPType::I64 => Ok(Type::I64),
WPType::F32 => Ok(Type::F32),
WPType::F64 => Ok(Type::F64),
_ => Err(CompileError::ValidationError {
msg: "type cannot be converted into a core type".into(),
}),
}
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{:?}", self)

View File

@ -3,7 +3,7 @@ use crate::{
memory::Memory,
module::ModuleInner,
structures::TypedIndex,
types::{FuncIndex, LocalOrImport, MemoryIndex},
types::{LocalOrImport, MemoryIndex},
};
use std::{ffi::c_void, mem, ptr};