Module builtin

Source
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§

derefExperimental
Unstable placeholder for deref patterns.
type_ascribeExperimental
Unstable placeholder for type ascription.

Attribute Macros§

derive
Attribute macro used to apply derive macros.
global_allocator
Attribute macro applied to a static to register it as a global allocator.
test
Attribute macro applied to a function to turn it into a unit test.
alloc_error_handlerExperimental
Attribute macro applied to a function to register it as a handler for allocation failure.
autodiff_forwardExperimental
This macro uses forward-mode automatic differentiation to generate a new function. It may only be applied to a function. The new function will compute the derivative of the function to which the macro was applied.
autodiff_reverseExperimental
This macro uses reverse-mode automatic differentiation to generate a new function. It may only be applied to a function. The new function will compute the derivative of the function to which the macro was applied.
benchExperimental
Attribute macro applied to a function to turn it into a benchmark test.
cfg_accessibleExperimental
Keeps the item it’s applied to if the passed path is accessible, and removes it otherwise.
cfg_evalExperimental
Expands all #[cfg] and #[cfg_attr] attributes in the code fragment it’s applied to.
contracts_ensuresExperimental
Attribute macro applied to a function to give it a post-condition.
contracts_requiresExperimental
Attribute macro applied to a function to give it a precondition.
define_opaqueExperimental
Provide a list of type aliases and other opaque-type-containing type definitions to an item with a body. This list will be used in that body to define opaque types’ hidden types. Can only be applied to things that have bodies.
derive_constExperimental
Attribute macro used to apply derive macros for implementing traits in a const context.
test_caseExperimental
An implementation detail of the #[test] and #[bench] macros.