Re-exportsยง
use std::ops::Not;๐use rustc_ast::EnumDef;๐use rustc_ast::Expr;๐use rustc_ast::GenericParamKind;๐use rustc_ast::Generics;๐use rustc_ast::Param;๐use rustc_ast::Safety;๐use rustc_ast::VariantData;๐use rustc_attr_ir::Attribute;๐use rustc_attr_ir::AttributeKind;๐use rustc_attr_ir::ReprPacked;๐use rustc_attr_parsing::AttributeParser;๐use rustc_expand::base::ExtCtxt;๐use rustc_span::Ident;๐use rustc_span::Span;๐use rustc_span::Symbol;๐use rustc_span::kw;๐use rustc_span::sym;๐use thin_vec::ThinVec;๐use thin_vec::thin_vec;๐use crate::util::generic_param_to_arg;๐use crate::deriving;๐use crate::diagnostics;๐pub(crate) use rustc_ast as ast;๐pub(crate) use Substructure::*;๐
Macrosยง
Structsยง
- Block
OrExpr ๐ - The code snippets built up for derived code are sometimes used as blocks (e.g. in a function body) and sometimes used as expressions (e.g. in a match arm). This structure avoids committing to either form until necessary, avoiding the insertion of any unnecessary blocks.
- Field
Info ๐ - Summary of the relevant parts of a struct/enum field.
- Method
Def ๐ - Small
Vec ๐ - A
Vec-like container that can store a small number of elements inline. - Trait
Def ๐ - Type
Parameter ๐
Enumsยง
- Fieldless
Variants ๐Strategy - How to handle fieldless enum variants.
- Method
Body ๐ - Substructure ๐
- A helper that makes the code for several derive macros easier to write as they all have a similar base structure.
Functionsยง
- find_
type_ ๐parameters - This method helps to extract all the type parameters referenced from a
type. For a type parameter
<T>, it looks for either aTyPaththat is not global and starts withT, or aTyQPath. Also include bound generic params from the input type. - generics_
without_ ๐defaults