kanal
kanal copied to clipboard
StackCell
I couldn't stop thinking about how to maybe abstract all the unsafe
stuff into a single module.
This StackCell
should be sound (maybe I made a mistake), and could potentially be used.
This is just a sketch though. Maybe I made a mistake, and the code is also not especially clean yet.
It would be good if we could see a working prototype to test, then we can reshape the project around it.
Some helpful links for people who are willing to help: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md https://rust-unofficial.github.io/too-many-lists/fifth-stacked-borrows.html
Actually, this solution isn't quite sound yet, since there's a mutable reference to the value on the stack. value
has to be wrapped in an UnsafeCell
, and we can only hold a shared reference to it. I don't have time for fixing the code or integrating it into the project right now but might get to it on one of the following evenings.
No update for a long time, I'm closing the pull request, feel free to open a new issue if you got time to work on it.