libffi-rs icon indicating copy to clipboard operation
libffi-rs copied to clipboard

Make FnPtrN: !Sync + !Send

Open tov opened this issue 4 years ago • 0 comments

This is intended to fix a soundness bug, the first item in #34, namely:

It erases all auto trait information attached to closure captures (read: Send and Sync)

The simplest fix is to make FnPtrN !Send and !Sync. This means we generally cannot pass our closures between threads, which may not be a satisfactory solution. An alternative PR I am working on will attempt to thread the auto traits from the original Rust closure through the Closure…N to the FnPtrN.

tov avatar Dec 20 '21 18:12 tov