|
|
Subscribe / Log in / New account

Rust functions are a bit more complicated than described

Rust functions are a bit more complicated than described

Posted Oct 23, 2025 22:20 UTC (Thu) by daroc (editor, #160859)
In reply to: Rust functions are a bit more complicated than described by NYKevin
Parent article: DebugFS on Rust

Thank you; that's a helpful clarification. I knew about the distinction between function pointers and function types, but I had misremembered which part of the compiler used the type information to emit static calls. I'll add a correction.


to post comments

Rust functions are a bit more complicated than described

Posted Oct 26, 2025 14:31 UTC (Sun) by pbonzini (subscriber, #60935) [Link]

For what it's worth, the same function type "rematerialization" is quite pervasive in QEMU's experimental Rust bindings.

The Rust wrappers for QEMU callbacks take the target Rust function as a type parameter, and a utility trait is added to Fn that causes a compiler error if that function is not zero-sized (https://lists.nongnu.org/archive/html/qemu-rust/2024-12/m...).


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds