Skip to content

no suggestion to enable const generics features #139645

@lcnr

Description

@lcnr
Contributor
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

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Apr 10, 2025
changed the title [-]no suggestion to enable `feature(generic_const_parameter_types)`[/-] [+]no suggestion to enable const generics features[/+] on Apr 10, 2025
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-bugCategory: This is a bug.
A-const-genericsArea: const generics (parameters and arguments)
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @fmease@lcnr@rustbot

        Issue actions

          no suggestion to enable const generics features · Issue #139645 · rust-lang/rust