Procedural macros should not be used

Guideline: Procedural macros should not be used gui_66FSqzD55VRZ
status: draft
tags: readability, reduce-human-error
category: advisory
decidability: decidable
scope: crate
release: 1.85.0;1.85.1

Macros should be expressed using declarative syntax in preference to procedural syntax.

Rationale: rat_AmCavSymv3Ev
status: draft
parent needs: gui_66FSqzD55VRZ

Procedural macros are not restricted to pure transcription and can contain arbitrary Rust code. This means they can be harder to understand, and cannot be as easily proved to work as intended. Procedural macros can have arbitrary side effects, which can exhaust compiler resources or expose a vulnerability for users of adopted code.

Non-Compliant Example: non_compl_ex_pJhVZW6a1HP9
status: draft
parent needs: gui_66FSqzD55VRZ

(example of a simple expansion using a proc-macro)

// TODO
fn main() {}
Compliant Example: compl_ex_4VFyucETB7C3
status: draft
parent needs: gui_66FSqzD55VRZ

(example of the same simple expansion using a declarative macro)

// TODO
fn main() {}