cargo-c
cargo-c copied to clipboard
Generate `nodiscard` for `#[must_use]` functions
Hello!
Since C23 there's the nodiscard attribute, I was wondering if marking an exported Rust function with #[must_use] should also set this attribute in the generated header file.
Thanks!
that would be a great question for bindgen I guess.
Good pointer, it seems there's https://github.com/rust-lang/rust-bindgen/pull/2081 but only for types
I try to use the latest bindgen for the built-in support, in case another generator gets that first, you can still invoke it via build.rs and configure cargo-c to use the generated assets.