Brainstorming syntax for const derive
github.com/rust-lang/rust-project-goals
Const Generics
opened 06:54PM - 22 Jul 24 UTC
nikomatsakis
T-lang C-tracking-issue
| Metadata | | | -------- | --- | | Point of contact | @BoxyUwU …| | Team(s) | lang | | Goal document | 2025h2/const-generics | ## Summary Work towards stabilizing the remaining const generics functionality that was left out of the original min_const_generics feature. ## Tasks and status * [x] Design meeting (lang ![Team][]) * [ ] adt_const_params RFC draft (@BoxyUwU) * [x] Finish mgca prototype (@BoxyUwU, @camelid) [Team]: https://img.shields.io/badge/Team%20ask-red --- Note: we have updated the body to match the 2025h2 goal. Your original text is preserved below.
min_generic_const_args implementation to address challenges found with the existing approach to supporting generic parameters in const generic arguments. ## Tasks and status * [ ] Discussion and moral support (lang, types ![Team][]) * [ ] Implementation and mentoring (@BoxyUwu) * [ ] Implementation (@camelid, @compiler-errors) * [ ] Reviewer (@compiler-errors) [Team]: https://img.shields.io/badge/Team%20ask-red
fn mk_array<T: const Default + Trait>() -> [T; T::ASSOC] {
[const { T::default() }; _]
}
The derive would likely have to constrict params to const in the same way that "imperfect derives" work today.
Discussion in the ATmosphere