Skip to content

No default in Shape struct when using top level #[facet(default)] on struct #2112

@wiiznokes

Description

@wiiznokes

on master commit edb322b

#[derive(Facet, Debug, Default)]
#[facet(default)]
pub struct DefaultTraitStruct {
    x: i32,
}

Shape {
    id: TypeId(0xead52af70e3cd2b7db1219fcd9baff19),
    layout: Sized(Layout { size: 4, align: 4 (1 << 2) }),
    vtable: VTable { .. },
    marker_traits: (empty),
    ty: User(
        Struct(
            StructType {
                repr: Repr {
                    base: Rust,
                    packed: false,
                },
                kind: Struct,
                fields: [
                    Field {
                        name: "x",
                        rename: None,
                        alias: None,
                        shape: Shape { type_identifier: "i32", ty: Primitive(Numeric(Integer { signed: true })), layout: Sized(«4 align 4»), def: Scalar, .. },
                        offset: 0,
                        flags: (empty),
                        attributes: [],
                        doc: [],
                        default: None,
                        skip_serializing_if: None,
                        invariants: None,
                        proxy: None,
                        format_proxies: [],
                        metadata: None,
                    },
                ],
            },
        ),
    ),
    def: Undefined,
    type_identifier: "DefaultTraitStruct",
    type_params: [],
    const_params: [],
    doc: [],
    attributes: [
        default(()),
    ],
    type_tag: None,
    inner: None,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions