Semantic FFI Bindings in Rust -
Reactivating the Borrow Checker
In this post:
Rust references, opaque handles and ownership
Likely pitfalls or: c_void isn't (yet) C's void
One big caveat
Lifetime-generic opaque references and callbacks
Prerequisites:The Rustonomicon's pages on How Safe and Unsafe Interact and...
blog.schichler.dev14 min read
Mazdak Farrokhzad
"Higher-ranked type alias" isn't entirely right here, but its good to think about the type theory. What you have on RHS is a prenex (rank-0) polymorphic type, and the type alias itself is still in prenex form. You would need e.g.,
for<'a> fn(fn(&'a u8))to have a rank-1 type, which would indeed be higher ranked.