Add dyn to traits and bump Rust version
This commit is contained in:
@@ -11,7 +11,7 @@ utility or as a library embedded in a larger application.
|
||||
|
||||
[](https://dev.azure.com/CraneStation/Wasmtime/_build/latest?definitionId=4&branchName=master)
|
||||
[](https://gitter.im/CraneStation/Lobby)
|
||||

|
||||

|
||||
|
||||
Wasmtime passes the WebAssembly spec testsuite, and supports a new system
|
||||
API proposal called [WebAssembly System Interface], or WASI.
|
||||
|
||||
@@ -25,7 +25,7 @@ pub trait SymbolResolver {
|
||||
pub fn emit_dwarf(
|
||||
artifact: &mut Artifact,
|
||||
mut dwarf: Dwarf,
|
||||
symbol_resolver: &SymbolResolver,
|
||||
symbol_resolver: &dyn SymbolResolver,
|
||||
) -> result::Result<(), failure::Error> {
|
||||
let endian = RunTimeEndian::Little;
|
||||
|
||||
@@ -61,11 +61,11 @@ pub fn emit_dwarf(
|
||||
pub struct WriterRelocate<'a> {
|
||||
relocs: Vec<DebugReloc>,
|
||||
writer: EndianVec<RunTimeEndian>,
|
||||
symbol_resolver: &'a SymbolResolver,
|
||||
symbol_resolver: &'a dyn SymbolResolver,
|
||||
}
|
||||
|
||||
impl<'a> WriterRelocate<'a> {
|
||||
pub fn new(endian: RunTimeEndian, symbol_resolver: &'a SymbolResolver) -> Self {
|
||||
pub fn new(endian: RunTimeEndian, symbol_resolver: &'a dyn SymbolResolver) -> Self {
|
||||
WriterRelocate {
|
||||
relocs: Vec::new(),
|
||||
writer: EndianVec::new(endian),
|
||||
|
||||
@@ -96,7 +96,7 @@ fn get_function_address_map<'data>(
|
||||
context: &Context,
|
||||
data: &FunctionBodyData<'data>,
|
||||
body_len: usize,
|
||||
isa: &isa::TargetIsa,
|
||||
isa: &dyn isa::TargetIsa,
|
||||
) -> FunctionAddressMap {
|
||||
let mut instructions = Vec::new();
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ impl Context {
|
||||
}
|
||||
|
||||
/// Construct a new instance of `Context` with the given target.
|
||||
pub fn with_isa(isa: Box<TargetIsa>) -> Self {
|
||||
pub fn with_isa(isa: Box<dyn TargetIsa>) -> Self {
|
||||
Self::new(Box::new(Compiler::new(isa)))
|
||||
}
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ impl Instance {
|
||||
}
|
||||
|
||||
/// Return a reference to the custom state attached to this instance.
|
||||
pub fn host_state(&mut self) -> &mut Any {
|
||||
pub fn host_state(&mut self) -> &mut dyn Any {
|
||||
&mut *self.host_state
|
||||
}
|
||||
|
||||
@@ -855,7 +855,7 @@ impl InstanceHandle {
|
||||
}
|
||||
|
||||
/// Return a reference to the custom state attached to this instance.
|
||||
pub fn host_state(&mut self) -> &mut Any {
|
||||
pub fn host_state(&mut self) -> &mut dyn Any {
|
||||
self.instance_mut().host_state()
|
||||
}
|
||||
|
||||
|
||||
@@ -527,7 +527,7 @@ impl VMContext {
|
||||
///
|
||||
/// This is unsafe because it doesn't work on just any `VMContext`, it must
|
||||
/// be a `VMContext` allocated as part of an `Instance`.
|
||||
pub unsafe fn host_state(&mut self) -> &mut Any {
|
||||
pub unsafe fn host_state(&mut self) -> &mut dyn Any {
|
||||
self.instance().host_state()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user