Closed
Description
Hello, really nice article, but there is one important point!
According to Nomicon https://doc.rust-lang.org/nomicon/ffi.html#ffi-and-panics
A panic! across an FFI boundary is undefined behavior.
I don't say that article should dig so deep, but please add Note/warning that in real use all functions that are called from FFI should use catch_unwind and report errors to native code in other way.
Taking into account that it could be used with any user-provided impls of Write, that is fairly possible to encounter panics.
P.S. Rust's catch unwind is fairly cheap and creates small overhead in case no panic actually happen,
Metadata
Metadata
Assignees
Labels
No labels