Skip to content

Cannot have static tuple structs #17649

Closed
@carllerche

Description

@carllerche

Right now, if I have the following:

struct Foo(pub uint);

I cannot have a static instance of the struct like so:

static FOO: Foo = Foo(1);

I get the following error:

function calls in constants are limited to struct and enum constructors

Edit: This seems like a dup of #17169

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