On Thu, Feb 27, 2025 at 10:29 PM Boqun Feng <boqun.feng@xxxxxxxxx> wrote: > > On Thu, Feb 27, 2025 at 05:02:02PM +0000, Alice Ryhl wrote: > > This validates at compile time that the signatures match what is in the > > header file. It highlights one annoyance with the compile-time check, > > which is that it can only be used with functions marked unsafe. > > > > If the function is not unsafe, then this error is emitted: > > > > error[E0308]: `if` and `else` have incompatible types > > Is there a way to improve this error message? I vaguely remember there > are ways to do customized error message. The if/else error message is super nice because it shows the two types next to each other where it's very easy to read the signatures and spot the difference. But if you want to investigate other constructs that potentially have better error messages, feel free. I'm happy to update if you find a better construct. Alice