Annotating types with #[must-use]

bindgen can be instructed to annotate certain types with #[must_use].

Some libraries have a common error type, returned by lots of their functions, which needs to be checked after every call. In these cases it's useful to add #[must_use] to this type, so the Rust compiler emits a warning when the check is missing.

Library

Command Line

  • --must-use-type <regex>

Annotations

/** <div rustbindgen mustusetype></div> */
struct ErrorType {
    // ...
};

...
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy