rust-lang / rust-lang/rust

no suggestion to enable const generics features

Open
#139,645 1 comment 2 reactions 1 assignee View on GitHub

@LaneAsade is already working on this.

Since Feb 16, 2026.

A-const-generics C-bug F-generic_const_parameter_types T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.