Make module info store FuncSig, not Arc<FuncSig>

This commit is contained in:
Lachlan Sneff
2019-02-08 14:19:58 -08:00
parent 1886b3d3c1
commit aa90a33501
9 changed files with 55 additions and 47 deletions

View File

@ -1,7 +1,6 @@
use crate::types::{
FuncSig, GlobalDescriptor, MemoryDescriptor, MemoryIndex, TableDescriptor, TableIndex, Type,
};
use std::sync::Arc;
pub type Result<T> = std::result::Result<T, Error>;
pub type CompileResult<T> = std::result::Result<T, CompileError>;
@ -42,8 +41,8 @@ pub enum LinkError {
IncorrectImportSignature {
namespace: String,
name: String,
expected: Arc<FuncSig>,
found: Arc<FuncSig>,
expected: FuncSig,
found: FuncSig,
},
ImportNotFound {
namespace: String,
@ -117,16 +116,9 @@ impl PartialEq for RuntimeError {
/// Comparing two `ResolveError`s always evaluates to false.
#[derive(Debug, Clone)]
pub enum ResolveError {
Signature {
expected: Arc<FuncSig>,
found: Vec<Type>,
},
ExportNotFound {
name: String,
},
ExportWrongType {
name: String,
},
Signature { expected: FuncSig, found: Vec<Type> },
ExportNotFound { name: String },
ExportWrongType { name: String },
}
impl PartialEq for ResolveError {