-
Notifications
You must be signed in to change notification settings - Fork 116
Lots of changes, not sure if actually safe yet. #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Make Lua Send * Add Send bounds to (nearly) all instances where userdata and functions are passed to Lua * Add a "scope" method which takes a callback that accepts a `Scope`, and give `Scope` the ability to create functions and userdata that are !Send, *and also functions that are not even 'static!*.
A key realization for me was that everywhere that I've ever NEEDED to give a !Send type to Lua, it has always been some sort of lock, like |
One thing that's not tested here that should be tested is accessing expired values through |
now no longer aborts if a Drop impl panics
I've slept on it, and discussed it within chucklefish, and I still feel pretty good about this change. We, at least, can't figure out a way to trick it into unsafety (famous last words). I think I'm going to go ahead and merge this into master, but I'd still like to discuss it before doing another major rlua release. It is potentially the most annoying API change yet because of the new requirement of userdata to be Send, I don't really have a good sense of the amount of pain this will cause. |
… internal It is part of the contract that only LuaRef types constructed from the same parent Lua state are passed into Lua, so generating a panic there is not an internal error.
Well, I merged this, but I actually screwed up the lifetimes in I'm currently staring that the crossbeam crate trying to figure out the correct technique. |
passed to Lua
Scope
, and giveScope
the ability to create functions and userdata that are !Send, and alsofunctions that are not 'static!.