TomBebbington / jit.rs

LibJIT wrapper for Rust
http://tombebbington.github.io/jit.rs/jit/index.html
MIT License
59 stars 11 forks source link

Start updating for the latest Rust builds #8

Closed emk closed 9 years ago

emk commented 9 years ago

This looks like a really cool library, and I'd love to try it! Thank you for all the work you've put in, and I appreciate how hard it's been to keep things building over the last couple of months.

I haven't managed to get this building with the latest Rust nightlies yet (I'm blocked by the Rust compiler bug https://github.com/rust-lang/rust/issues/25279), but I've made a fair bit of progress. This pull request contains all the build fixes I've figured out so far, and I hope to add more in the future if I make further progress.

Once again, many thanks!

emk commented 9 years ago

OK, at this point, all of the crates build correctly, and all the unit tests pass. However, both of the example programs still fail with errors like the following:

/home/.../jit.rs/examples/hello_world.rs:22:19: 22:34 error: the trait `jit::compile::Compile<'_>` is not implemented for the type `fn(&str)` [E0277]
/home/.../rust-libs/jit.rs/examples/hello_world.rs:22         let sig = get::<fn(&str)>();

For some reason, the following declarations don't seem to be creating the necessary Compile instances:

compile_func!(fn() -> R, fn() -> R, extern fn() -> R);
compile_func!(fn(A) -> R, fn(A) -> R, extern fn(A) -> R);
compile_func!(fn(A, B) -> R, fn(A, B) -> R, extern fn(A, B) -> R);
compile_func!(fn(A, B, C) -> R, fn(A, B, C) -> R, extern fn(A, B, C) -> R);
compile_func!(fn(A, B, C, D) -> R, fn(A, B, C, D) -> R, extern fn(A, B, C, D) -> R);

I'll poke at this a bit later.

TomBebbington commented 9 years ago

Thanks for your contributions! I've been busy recently because of exams but thanks a lot for the necessary updates, I'll see what else needs to be done to get it to compile

emk commented 9 years ago

Thank you for merging my work, and for your library! I'm looking forward to trying out some rather weird ideas with libjit in Rust once it's working again.