Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Checklist

  • Development environment:

  • Libraries:

    • Rule - Check for outdated dependencies versions (cargo-outdated) (LIBS-OUTDATED)
    • Rule - Check for security vulnerabilities report on dependencies (cargo-audit) (LIBS-AUDIT)
  • Language guarantees:

    • Rule - No Undefined Behavior (UB-NOUB)
  • Naming:

  • Integer operations:

    • Rule - Use appropriate arithmetic operations regarding potential overflows (LANG-ARITH)
  • Error handling:

    • Recommendation - Implement custom Error type wrapping all possible errors (LANG-ERRWRAP)
    • Recommendation - Use the ? operator and do not use the try! macro (LANG-ERRDO)
    • Rule - Don't use functions that can cause panic! (LANG-NOPANIC)
    • Rule - Test properly array indexing or use the get method (LANG-ARRINDEXING)
    • Rule - Handle correctly panic! in FFI (LANG-FFIPANIC)
  • Central traits:

  • Generalities:

  • Memory management:

  • Foreign Function Interface:

    • Rule - Use only C-compatible types in FFI (FFI-CTYPE)
    • Rule - Use consistent types at FFI boundaries (FFI-TCONS)
    • Recommendation - Use automatic binding generator tools (FFI-AUTOMATE)
    • Rule - Use portable aliases c_* when binding to platform-dependent types (FFI-PFTYPE)
    • Rule - Do not use unchecked non-robust foreign values (FFI-CKNONROBUST)
    • Recommendation - Check foreign values in Rust (FFI-CKINRUST)
    • Recommendation - Do not use reference types but pointer types (FFI-NOREF)
    • Rule - Do not use unchecked foreign references (FFI-CKREF)
    • Rule - Check foreign pointers (FFI-CKPTR)
    • Rule - Mark function pointer types in FFI as extern and unsafe (FFI-MARKEDFUNPTR)
    • Rule - Check foreign function pointers (FFI-CKFUNPTR)
    • Recommendation - Do not use incoming Rust enum at FFI boundary (FFI-NOENUM)
    • Recommendation - Use dedicated Rust types for foreign opaque types (FFI-R-OPAQUE)
    • Recommendation - Use incomplete C/C++ struct pointers to make type opaque (FFI-C-OPAQUE)
    • Rule - Do not use types that implement Drop at FFI boundary (FFI-MEM-NODROP)
    • Rule - Ensure clear data ownership in FFI (FFI-MEM-OWNER)
    • Recommendation - Wrap foreign data in memory releasing wrapper (FFI-MEM-WRAPPING)
    • Rule - Handle panic! correctly in FFI (FFI-NOPANIC)
    • Recommendation - Provide safe wrapping to foreign library (FFI-SAFEWRAPPING)
    • Recommendation - Expose dedicated C-compatible API only (FFI-CAPI)
  • Standard library:

    • Recommendation - Justify Send and Sync implementation (LANG-SYNC-TRAITS)
    • Rule - Respect the invariants of standard comparison traits (LANG-CMP-INV)
    • Recommendation - Use the default method implementation of standard comparison traits (LANG-CMP-DEFAULTS)
    • Recommendation - Derive comparison traits when possible (LANG-CMP-DERIVE)