rhaiscript / playground

A Rhai scripting playground that runs Rhai scripts using WebAssembly in a web browser.
https://rhai.rs/playground
MIT License
20 stars 5 forks source link

Workaround bug with rhai 0.19.8 #8

Closed schungx closed 3 years ago

schungx commented 3 years ago

There is a bug in 0.19.8 that is fixed in 0.19.9. That bug causes a syntax error when accessing properties within a closure.

alvinhochun commented 3 years ago

0.19.9 does not build on WASM, however:

error[E0308]: mismatched types
   --> D:\dev\toolchain\rust\cargo\registry\src\github.com-1ecc6299db9ec823\rhai-0.19.9\src\engine.rs:788:30
    |
788 |             module_resolver: None,
    |                              ^^^^
    |                              |
    |                              expected struct `std::boxed::Box`, found enum `Option`
    |                              help: store this in the heap by calling `Box::new`: `Box::new(None)`
    |
    = note: expected struct `std::boxed::Box<(dyn ModuleResolver + 'static)>`
                 found enum `Option<_>`
    = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
schungx commented 3 years ago

Arrrrrgggghhhhhh.... yes, no_std was broken in 0.19.9. No worries then...

Maybe you can switch stable to 0.19.7?

alvinhochun commented 3 years ago

Ok, I moved stable to use 0.19.7.