Safety-Critical Rust Coding Guidelines

Contents:

  • Introduction
  • Overview
  • Coding Guidelines
    • Types and Traits
    • Patterns
    • Expressions
    • Values
    • Statements
    • Functions
    • Associated Items
    • Implementations
    • Generics
    • Attributes
    • Entities And Resolution
    • Ownership And Destruction
    • Exceptions And Errors
    • Concurrency
    • Program Structure And Compilation
    • Unsafety
    • Macros
      • Attribute macros shall not be used
      • A macro should not be used in place of a function
      • Procedural macros should not be used
      • Shall ensure complete hygiene of macros
      • Do not hide unsafe code in macros
      • Names in a macro definition shall use a fully qualified path
      • Shall not use Function-like Macros
      • Shall not invoke macros
      • Shall not use Declarative Macros
      • Shall not write code that expands macros
    • Ffi
    • Inline Assembly
  • Compliance
  • Process
  • Appendices
  • Retired Guidelines
Safety-Critical Rust Coding Guidelines
  • Coding Guidelines
  • Macros
  • View page source

Macros

  • Attribute macros shall not be used
  • A macro should not be used in place of a function
  • Procedural macros should not be used
  • Shall ensure complete hygiene of macros
  • Do not hide unsafe code in macros
  • Names in a macro definition shall use a fully qualified path
  • Shall not use Function-like Macros
  • Shall not invoke macros
  • Shall not use Declarative Macros
  • Shall not write code that expands macros
Previous Next

© Copyright 2025, Contributors to Coding Guidelines Subcommittee.

Built with Sphinx using a theme provided by Read the Docs. This site is powered through Netlify.