Skip to content

Remove old syntax for struct constructors #3297

@erickt

Description

@erickt

The old syntax for struct constructors is scheduled to be removed:

struct S {
    x: int,
    new() { self.x = 5 }
}

It should be replaced with:

struct S {
    x: int
}

fn S() {
    S { x: 5 }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions