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§
- Decodable
- Decodable_NoContext 
- Diagnostic
- Encodable
- Encodable_NoContext 
- HashStable 
- HashStable_ Generic 
- HashStable_ NoContext 
- HashStableimplementation that has no- HashStableContextbound and which adds- wherebounds for- HashStablebased off of fields and not generics. This is suitable for use in crates like- rustc_type_ir.
- Lift
- LintDiagnostic 
- MetadataDecodable 
- MetadataEncodable 
- PrintAttribute 
- 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
- TyEncodable
- TypeFoldable 
- Derives TypeFoldablefor the annotatedstructorenum(unionis not supported).
- TypeVisitable 
- Derives TypeVisitablefor the annotatedstructorenum(unionis not supported).
- Walkable
- Derives Walkablefor the annotatedstructorenum(unionis not supported).