Skip to content

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

Open

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)F-generic_const_parameter_types`#![feature(generic_const_parameter_types)]`: allowing `<T, const V: T>` (not yet implemented))

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions