Skip to content

migrate: map {0} initializers and memset-to-zero to T.zeroed() (D101) #2214

Closed

Description

@ehartford

D101 (2026-10-06): C's struct T x = {0}; and memset(&x, 0, sizeof x) mean exactly T.zeroed(). The migrator should emit that. Migrated code that relied on a struct literal written through an alias now meets the restored missing-field check (§4.3 rule 2), and T.zeroed() is the spelling that reads better. Refuse loudly when the record is not zero-valid (the error names the field), never fall back to a partial literal.

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