Macros§
Attribute Macros§
- extension
- Derive an extension trait for a given impl block. The trait name goes into the parenthesized args of the macro, for greppability. For example:
Derive Macros§
- Blob
Decodable - See docs on derive
Decodable. - Decodable
- Derives
Decodable<D> for T where D: SpanDecoder - Decodable_
NoContext - See docs on derive
Decodable. - Diagnostic
- Encodable
- Encodable_
NoContext - Hash
Stable - Hash
Stable_ Generic - Hash
Stable_ NoContext HashStableimplementation that has noHashStableContextbound and which addswherebounds forHashStablebased off of fields and not generics. This is suitable for use in crates likerustc_type_ir.- Lazy
Decodable - See docs on derive
Decodable. - Lift
- Lint
Diagnostic - Metadata
Encodable - Most encodable derives mirror a decodable derive.
MetadataEncodableis roughly mirrored by the combination ofLazyDecodableandBlobDecodable - Print
Attribute - Derives
PrintAttributeforAttributeKind. This macro is pretty specific torustc_hir::attrsand likely not that useful in other places. It’s deriving something close toDebugwithout printing some extraneous things like spans. - Subdiagnostic
- TyDecodable
- See docs on derive
Decodable. - TyEncodable
- Type
Foldable - Derives
TypeFoldablefor the annotatedstructorenum(unionis not supported). - Type
Visitable - Derives
TypeVisitablefor the annotatedstructorenum(unionis not supported). - Walkable
- Derives
Walkablefor the annotatedstructorenum(unionis not supported).