Skip to content

no suggestion to enable const generics features #139645

Open
@lcnr

Description

@lcnr
struct Bar<T, const N: T>(T);

results in

error[E0770]: the type of const parameters must not depend on other generic parameters
 --> src/lib.rs:1:24
  |
1 | struct Bar<T, const N: T, const M: u64 = N>(T);
  |                        ^ the type must not depend on the parameter `T`

For more information about this error, try `rustc --explain E0770`.
error: could not compile `playground` (lib) due to 1 previous error

It should suggest using feature(generic_const_parameter_types, adt_const_params) on nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.F-generic_const_parameter_types`#![feature(generic_const_parameter_types)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions