Attribute macros shall not be used

Guideline: Attribute macros shall not be used gui_13XWp3mb0g2P
status: draft
tags: reduce-human-error
category: required
decidability: decidable
scope: system
release: todo

Attribute macros shall neither be declared nor invoked. Prefer less powerful macros that only extend source code.

Rationale: rat_X8uCF5yx7Mpo
status: draft
parent needs: gui_13XWp3mb0g2P

Attribute macros are able to rewrite items entirely or in other unexpected ways which can cause confusion and introduce errors.

Non-Compliant Example: non_compl_ex_eW374waRPbeL
status: draft
parent needs: gui_13XWp3mb0g2P

The #[test] attribute macro transforms the function into a test harness entry point.

no run
#[test]  // non-compliant: attribute macro rewrites the item
fn example_test() {
    assert!(true);
}
Compliant Example: compl_ex_Mg8ePOgbGJeW
status: draft
parent needs: gui_13XWp3mb0g2P

Explanation of code example.

#[allow(dead_code)]
fn example_function() {
    // Compliant implementation
}