Expand description
Definitions of built-in macros.
Most of the macro properties (stability, visibility, etc.) are taken from the source code here, with exception of expansion functions transforming macro inputs into outputs, those functions are provided by the compiler.
Macros
- type_ascribeExperimentalUnstable placeholder for type ascription.
Attribute Macros
- alloc_error_handlerExperimentalAttribute macro applied to a function to register it as a handler for allocation failure.
- benchExperimentalAttribute macro applied to a function to turn it into a benchmark test.
- cfg_accessibleExperimentalKeeps the item it’s applied to if the passed path is accessible, and removes it otherwise.
- cfg_evalExperimentalExpands all
#[cfg]
and#[cfg_attr]
attributes in the code fragment it’s applied to. - derive_constExperimentalAttribute macro used to apply derive macros for implementing traits in a const context.
- test_caseExperimentalAn implementation detail of the
#[test]
and#[bench]
macros. - Attribute macro used to apply derive macros.
- Attribute macro applied to a static to register it as a global allocator.
- Attribute macro applied to a function to turn it into a unit test.
Derive Macros
- RustcDecodableDeprecatedUnstable implementation detail of the
rustc
compiler, do not use. - RustcEncodableDeprecatedUnstable implementation detail of the
rustc
compiler, do not use.