Skip to content

Error: The type of const parameters must not depend on other generic parameters #98210

Open
@Pzixel

Description

@Pzixel

The following code

struct Test<T, const VAL: T>(T);

Results in a "error[E0770]: the type of const parameters must not depend on other generic parameters" compilation error on current Nightly.

I would expect that there is some unstable feature generic_const_exprs but complier suggests none. I've seen enough people having this question so I think it worth having one issue to have all relevant answers/solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions