Derive Macro rustc_macros::TypeFoldable

source ·
#[derive(TypeFoldable)]
{
    // Attributes available to this derive:
    #[type_foldable]
}
Expand description

Derives TypeFoldable for the annotated struct or enum (union is not supported).

The fold will produce a value of the same struct or enum variant as the input, with each field respectively folded using the TypeFoldable implementation for its type. However, if a field of a struct or an enum variant is annotated with #[type_foldable(identity)] then that field will retain its incumbent value (and its type is not required to implement TypeFoldable).