Skip to content

Implement field_init_shorthand feature #1215

@MoSal

Description

@MoSal
#![feature(field_init_shorthand)]

struct AA{}
struct BB{}

struct CC {
    a: AA,
    b: BB
}

impl CC {
    fn new(a: AA, b: BB) -> Self {
        Self { a, b }
    }
}

cargo fmt error:

error: expected `:`, found `,`
  --> /tmp/foo/src/lib.rs:13:17
   |
13 |         Self { a, b }
   |                 ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues up for grabs, also good candidates for new rustfmt contributorsp-high

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions