Skip to content

Attribute for skipping field of struct in Debug derives? #37009

Open

Description

Could we have something like this?

#[derive(Debug)]
struct Foo {
    pub a: A,
    pub b: B,
    #[skip_derive]
    pub c: C, // especially useful if C : !Debug
}

This could also feasibly be applied to other auto-derivations, of course (not just Debug).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions