Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As far as I understand unwind safety in rust, this should be safe. First of all, because unwind "unsafety" in rust is already safe anyway, as shown by the absence of `unsafe` keyword. What it tries to prevent is witnessing a broken invariant in a capture, after a panic. Here, we replace `RefUnwindSafe` with an `AssertUnwindSafe` that is exclusively set on a value that will never be reused after the closure ends. Hence, to the best of my understanding this still keeps the informal contract of unwind safety in rust. In practice, it allows using wasm-smith’s Arbitrary implementation with `with_arbitrary`, without having to take bytes as arguments. Without that, wasm-smith’s ConfiguredModule contains elements that are not unwind safe, and would be rejected. I would add that the error message is particularly cryptic, and figuring out that unwind safety was the source of the issue required me to dig into bolero’s source code and use the fully-qualified method call syntax, because without that the full error would not be shown. It might be possible to hoist the remaining type checks to be earlier in the call chain (eg. at the with_arbitrary stage), but I haven’t investigated much deeper yet.
- Loading branch information