Skip to content

Commit 409ca02

Browse files
committed
fixed object safety warnings (I think)
1 parent 80c49e0 commit 409ca02

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/engine.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use value::{Function, Value};
1717
/// An abstract interface for implementation execution of LLVM modules.
1818
///
1919
/// This is designed to support both interpreter and just-in-time (JIT) compiler implementations.
20-
pub trait ExecutionEngine<'a, 'b:'a> where LLVMExecutionEngineRef:From<&'b Self> {
20+
pub trait ExecutionEngine<'a, 'b:'a>:Sized+'b where LLVMExecutionEngineRef:From<&'b Self> {
2121
/// The options given to the engine upon creation.
2222
type Options : Copy;
2323
/// Create a new execution engine with the given `Module` and options, or return a
@@ -130,9 +130,9 @@ impl<'a, 'b> JitEngine<'a> {
130130
mem::transmute(ptr)
131131
}
132132
}
133-
impl<'a, 'b:'a> ExecutionEngine<'a, 'b> for JitEngine<'a> {
133+
impl<'a, 'b:'a> ExecutionEngine<'a, 'b> for JitEngine<'b> {
134134
type Options = JitOptions;
135-
fn new(module: &'a Module, options: JitOptions) -> Result<JitEngine<'a>, CBox<str>> {
135+
fn new(module: &'a Module, options: JitOptions) -> Result<JitEngine<'b>, CBox<str>> {
136136
unsafe {
137137
let mut ee = mem::uninitialized();
138138
let mut out = mem::zeroed();
@@ -176,9 +176,9 @@ impl<'a> Interpreter<'a> {
176176
unsafe { engine::LLVMRunFunction(self.into(), function.into(), args.len() as c_uint, ptr).into() }
177177
}
178178
}
179-
impl<'a, 'b:'a> ExecutionEngine<'a, 'b> for Interpreter<'a> {
179+
impl<'a, 'b:'a> ExecutionEngine<'a, 'b> for Interpreter<'b> {
180180
type Options = ();
181-
fn new(module: &'a Module, _: ()) -> Result<Interpreter<'a>, CBox<str>> {
181+
fn new(module: &'a Module, _: ()) -> Result<Interpreter<'b>, CBox<str>> {
182182
unsafe {
183183
let mut ee = mem::uninitialized();
184184
let mut out = mem::zeroed();

0 commit comments

Comments
 (0)