SQ in silver chrome letters, a lab's gear stacked against the S: a rack, two oscilloscopes, pizza boxes and a six-pack. Strange Query Lab
Chapters

rust-cardiac

  1. Contents
  2. Lexical structure
  3. Macros
  4. Items
  5. Attributes
  6. Statements and expressions
  7. Patterns
  8. Types
  9. Memory
  10. Panic
  11. Unsafety
  12. Constant evaluation
  13. The runtime
  14. Appendix: The core library

CARDIAC › rust-cardiac › Language Reference › Attributes

Attributes

What's different on CARDIAC

  • #[inline(never)] matters more than in Rust, because every copy of a helper comes out of 96 cells.
  • #[derive(Debug)] works only on a value that is never formatted, since nothing can be printed but numbers.
  • Everything else on this page works as in Rust.

Derive

Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord and Hash work. Debug works on a value that is never formatted.

Code generation

#[inline], #[inline(never)] and #[cold] work. #[inline(never)] keeps one shared copy of a helper where rustc would copy it into every caller: see Items.

Type layout

#[repr] works, for example #[repr(i16)] or #[repr(u8)] on a C-like enum.

Conditional compilation

#[cfg] and cfg! work.

Testing and diagnostics

#[test] functions can sit beside the program. #[track_caller] works.

Feature tests: attributes.