Add dyn to traits and bump Rust version

This commit is contained in:
Artur Jamro
2019-08-15 14:52:33 -07:00
committed by Dan Gohman
parent 9a57580258
commit 7009c8dd73
6 changed files with 9 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ utility or as a library embedded in a larger application.
[![Build Status](https://dev.azure.com/CraneStation/Wasmtime/_apis/build/status/CraneStation.wasmtime?branchName=master)](https://dev.azure.com/CraneStation/Wasmtime/_build/latest?definitionId=4&branchName=master) [![Build Status](https://dev.azure.com/CraneStation/Wasmtime/_apis/build/status/CraneStation.wasmtime?branchName=master)](https://dev.azure.com/CraneStation/Wasmtime/_build/latest?definitionId=4&branchName=master)
[![Gitter chat](https://badges.gitter.im/CraneStation/CraneStation.svg)](https://gitter.im/CraneStation/Lobby) [![Gitter chat](https://badges.gitter.im/CraneStation/CraneStation.svg)](https://gitter.im/CraneStation/Lobby)
![Minimum rustc 1.36](https://img.shields.io/badge/rustc-1.36+-green.svg) ![Minimum rustc 1.37](https://img.shields.io/badge/rustc-1.37+-green.svg)
Wasmtime passes the WebAssembly spec testsuite, and supports a new system Wasmtime passes the WebAssembly spec testsuite, and supports a new system
API proposal called [WebAssembly System Interface], or WASI. API proposal called [WebAssembly System Interface], or WASI.

View File

@@ -25,7 +25,7 @@ pub trait SymbolResolver {
pub fn emit_dwarf( pub fn emit_dwarf(
artifact: &mut Artifact, artifact: &mut Artifact,
mut dwarf: Dwarf, mut dwarf: Dwarf,
symbol_resolver: &SymbolResolver, symbol_resolver: &dyn SymbolResolver,
) -> result::Result<(), failure::Error> { ) -> result::Result<(), failure::Error> {
let endian = RunTimeEndian::Little; let endian = RunTimeEndian::Little;
@@ -61,11 +61,11 @@ pub fn emit_dwarf(
pub struct WriterRelocate<'a> { pub struct WriterRelocate<'a> {
relocs: Vec<DebugReloc>, relocs: Vec<DebugReloc>,
writer: EndianVec<RunTimeEndian>, writer: EndianVec<RunTimeEndian>,
symbol_resolver: &'a SymbolResolver, symbol_resolver: &'a dyn SymbolResolver,
} }
impl<'a> WriterRelocate<'a> { 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 { WriterRelocate {
relocs: Vec::new(), relocs: Vec::new(),
writer: EndianVec::new(endian), writer: EndianVec::new(endian),

View File

@@ -96,7 +96,7 @@ fn get_function_address_map<'data>(
context: &Context, context: &Context,
data: &FunctionBodyData<'data>, data: &FunctionBodyData<'data>,
body_len: usize, body_len: usize,
isa: &isa::TargetIsa, isa: &dyn isa::TargetIsa,
) -> FunctionAddressMap { ) -> FunctionAddressMap {
let mut instructions = Vec::new(); let mut instructions = Vec::new();

View File

@@ -105,7 +105,7 @@ impl Context {
} }
/// Construct a new instance of `Context` with the given target. /// 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))) Self::new(Box::new(Compiler::new(isa)))
} }

View File

@@ -441,7 +441,7 @@ impl Instance {
} }
/// Return a reference to the custom state attached to this 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 &mut *self.host_state
} }
@@ -855,7 +855,7 @@ impl InstanceHandle {
} }
/// Return a reference to the custom state attached to this 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 {
self.instance_mut().host_state() self.instance_mut().host_state()
} }

View File

@@ -527,7 +527,7 @@ impl VMContext {
/// ///
/// This is unsafe because it doesn't work on just any `VMContext`, it must /// This is unsafe because it doesn't work on just any `VMContext`, it must
/// be a `VMContext` allocated as part of an `Instance`. /// 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() self.instance().host_state()
} }