Skip to content

use case: initialize struct with one field pointing to another #172

@andrewrk

Description

@andrewrk
const array_of_things = []Thing {
    foo(),
    foo(),
};

struct Thing {
    field1: &i32,
    field2: i32,
}

fn foo() -> Thing {
    Thing {
        field1: // somehow make this reference field2
        field2: 1234,
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions