Support fn() types as const generic parameters
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Currently even with custom ADT const generics, fn() types are not allowed as const generic parameters types.
Adding that support would quite useful as it would allow to specify a ZST type that implements the Fn/FnOnce/FnMut traits by calling a const fn() value from a conat generic parameter (typically from an fb item), guaranteeing monomorphization.
Currently it seems the only way to do this is to manually create with a macro a separate type for each fn item.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the issue description and trace the compiler's existing custom ADT const-generic support for function types. Determine the required language and compiler changes for accepting fn() types as const generic parameters, then add coverage demonstrating calls to const fn values and Fn/FnOnce/FnMut behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100