Skip to content

RFC: C99-style designated initializers #11936

Closed
@edwardw

Description

@edwardw

On several occasions I found myself in the need of C99-style designated initializer to initialize a static sparse array, like so:

int a[128] = { [0] = 1, [64] = 2 };

It is just too error-prone, tedious and unsightly to type all remaining zeros. Note C99 designated initializer can also be applied to aggregate types but I doubt it would be as useful in rust.

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