---
title: "Discussion on \"Semantic FFI Bindings in Rust -\nReactivating the Borrow Checker\" | Hashnode"
description: "Discussion on \"Semantic FFI Bindings in Rust -\nReactivating the Borrow Checker\". In this post:\n\nRust references, opaque handles and ownership\nLikely pitfalls or: c_void isn't (yet) C's void\nOne big caveat\nLifetime-generic opaque references and callbacks\n\n\n\nPrerequisites:The Rustonomicon's pages on How Safe and Unsafe Interact and..."
url: "https://hashnode.com/posts/semantic-ffi-bindings-in-rust-reactivating-the-borrow-checker/5f9d7e7fb309125fbb61a4c0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Semantic FFI Bindings in Rust - Reactivating the Borrow Checker](https://blog.schichler.dev/semantic-ffi-bindings-in-rust-reactivating-the-borrow-checker?utm_source=hashnode&utm_medium=feed)

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...

Oct 31, 2020 · 14 min read · blog.schichler.dev  
Updated Nov 6, 2020  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#embedded](https://hashnode.com/tag/embedded)

## Written by

[Tamme Schichler](https://hashnode.com/@Tamme)

@Tamme

  
[View profile](https://hashnode.com/@Tamme)

Increasingly doing a little of everything 🃏

## Responses 1

Markdown supported · ⌘↵ to post

[Mazdak Farrokhzad](https://hashnode.com/@centril)

[Nov 6, 2020](https://hashnode.com/posts/semantic-ffi-bindings-in-rust-reactivating-the-borrow-checker/5f9d7e7fb309125fbb61a4c0/comment/5fa51e0747631a19e811ff67)

> I just came up with the name \[...\]

"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.

[Tamme Schichler](https://hashnode.com/@Tamme)

[Nov 6, 2020](https://hashnode.com/posts/semantic-ffi-bindings-in-rust-reactivating-the-borrow-checker/5f9d7e7fb309125fbb61a4c0/comment/5fa51e0747631a19e811ff67#reply-5fa544b847631a19e8120228)

Thank you, this gave me enough pointers [to look the terms up properly](https://en.wikipedia.org/w/index.php?title=Parametric_polymorphism&oldid=984123256).

I've (hopefully) corrected the post in this regard, by switching from "higher-ranked type alias" to "type alias to a polymorphic function pointer type". The changeset can be seen [here](https://github.com/Tamschi/Abstraction-Haven-Backup/commit/f694c830a55a002cf9e5629baf565599a62315c5).

[Mazdak Farrokhzad](https://hashnode.com/@centril)

[Nov 6, 2020](https://hashnode.com/posts/semantic-ffi-bindings-in-rust-reactivating-the-borrow-checker/5f9d7e7fb309125fbb61a4c0/comment/5fa51e0747631a19e811ff67#reply-5fa55d3d54cc5b4ad931df00)

Sure thing! Your correction looks spot on to me.
