rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Allow adding extra documentation to bindgen-generated entities

Open HadrienG2 opened this issue 1 year ago • 1 comments

C libraries are not always very careful about documenting their safety requirements. But unsafe rust functions are expected to document in which circumstances they are safe to use. To resolve this impedance mismatch without huge upstream doc contributions, which may be rejected, it would be nice if one could append manually written # Safety sections to bindgen's autogenerated function docs. This could take the form of a HashMap from C function name to safety docs.

HadrienG2 avatar Feb 12 '24 08:02 HadrienG2

This could be seen as a particular case of https://github.com/rust-lang/rust-bindgen/issues/2739

pvdrz avatar Apr 03 '24 16:04 pvdrz