Fix clippy.toml paths and a few clippy lints.
This commit is contained in:
@@ -93,7 +93,7 @@ impl Context {
|
|||||||
&mut *self.compiler,
|
&mut *self.compiler,
|
||||||
&data,
|
&data,
|
||||||
&mut self.namespace,
|
&mut self.namespace,
|
||||||
Rc::clone(&mut self.global_exports),
|
Rc::clone(&self.global_exports),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,11 +170,11 @@ impl Context {
|
|||||||
instance_name: &str,
|
instance_name: &str,
|
||||||
field: &str,
|
field: &str,
|
||||||
) -> Result<ActionOutcome, ContextError> {
|
) -> Result<ActionOutcome, ContextError> {
|
||||||
let mut instance = self
|
let instance = self
|
||||||
.get_instance(&instance_name)
|
.get_instance(&instance_name)
|
||||||
.map_err(ContextError::Instance)?
|
.map_err(ContextError::Instance)?
|
||||||
.clone();
|
.clone();
|
||||||
self.get(&mut instance, field).map_err(ContextError::Action)
|
self.get(&instance, field).map_err(ContextError::Action)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the value of an exported global variable from an instance.
|
/// Get the value of an exported global variable from an instance.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ pub fn link_module(
|
|||||||
signature, import_signature)
|
signature, import_signature)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
dependencies.insert(InstanceHandle::from_vmctx(vmctx));
|
dependencies.insert(unsafe { InstanceHandle::from_vmctx(vmctx) });
|
||||||
function_imports.push(VMFunctionImport {
|
function_imports.push(VMFunctionImport {
|
||||||
body: address,
|
body: address,
|
||||||
vmctx,
|
vmctx,
|
||||||
@@ -82,7 +82,7 @@ pub fn link_module(
|
|||||||
module_name, field,
|
module_name, field,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
dependencies.insert(InstanceHandle::from_vmctx(vmctx));
|
dependencies.insert(unsafe { InstanceHandle::from_vmctx(vmctx) });
|
||||||
table_imports.push(VMTableImport {
|
table_imports.push(VMTableImport {
|
||||||
from: definition,
|
from: definition,
|
||||||
vmctx,
|
vmctx,
|
||||||
@@ -136,7 +136,7 @@ pub fn link_module(
|
|||||||
}
|
}
|
||||||
assert!(memory.offset_guard_size >= import_memory.offset_guard_size);
|
assert!(memory.offset_guard_size >= import_memory.offset_guard_size);
|
||||||
|
|
||||||
dependencies.insert(InstanceHandle::from_vmctx(vmctx));
|
dependencies.insert(unsafe { InstanceHandle::from_vmctx(vmctx) });
|
||||||
memory_imports.push(VMMemoryImport {
|
memory_imports.push(VMMemoryImport {
|
||||||
from: definition,
|
from: definition,
|
||||||
vmctx,
|
vmctx,
|
||||||
@@ -180,7 +180,7 @@ pub fn link_module(
|
|||||||
module_name, field
|
module_name, field
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
dependencies.insert(InstanceHandle::from_vmctx(vmctx));
|
dependencies.insert(unsafe { InstanceHandle::from_vmctx(vmctx) });
|
||||||
global_imports.push(VMGlobalImport { from: definition });
|
global_imports.push(VMGlobalImport { from: definition });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -760,8 +760,8 @@ impl InstanceHandle {
|
|||||||
|
|
||||||
/// Create a new `InstanceHandle` pointing at the instance
|
/// Create a new `InstanceHandle` pointing at the instance
|
||||||
/// pointed to by the given `VMContext` pointer.
|
/// pointed to by the given `VMContext` pointer.
|
||||||
pub fn from_vmctx(vmctx: *mut VMContext) -> Self {
|
pub unsafe fn from_vmctx(vmctx: *mut VMContext) -> Self {
|
||||||
let instance = unsafe { (&mut *vmctx).instance() };
|
let instance = (&mut *vmctx).instance();
|
||||||
instance.refcount += 1;
|
instance.refcount += 1;
|
||||||
Self { instance }
|
Self { instance }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
unstable_features
|
unstable_features
|
||||||
)]
|
)]
|
||||||
#![warn(unused_import_braces)]
|
#![warn(unused_import_braces)]
|
||||||
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../clippy.toml")))]
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::new_without_default, clippy::new_without_default_derive)
|
allow(clippy::new_without_default, clippy::new_without_default_derive)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
unstable_features
|
unstable_features
|
||||||
)]
|
)]
|
||||||
#![warn(unused_import_braces)]
|
#![warn(unused_import_braces)]
|
||||||
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../clippy.toml")))]
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::new_without_default, clippy::new_without_default_derive)
|
allow(clippy::new_without_default, clippy::new_without_default_derive)
|
||||||
|
|||||||
Reference in New Issue
Block a user