artichoke / ferrocarril

🚆 Experiments to embed Ruby on Rails in Rust with mruby
https://artichoke.github.io/ferrocarril/mruby/
MIT License
62 stars 2 forks source link

Add a type bound to rust_data_free #190

Closed lopopolo closed 5 years ago

lopopolo commented 5 years ago

rust_data_free expects to free an pointer to an Rc<RefCell> that was created by RustBackedValue::try_into_ruby. Enforce this assumption with a type bound on the function so it can only be attached to the mruby VM for objects it can free safely.