RustCrypto / RustCrypto/hybrid-array

Investigate `min_generic_const_args` for handling array sizes generically

Open
#180 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
23
Forks
25
Avg merge
1h 46m
Merged PRs (30d)
1

Description

Currently we use macros to write a fixed set of supported sizes, which is inflexible and we would ideally support arbitrary sizes instead (#81). See:

https://github.com/RustCrypto/hybrid-array/blob/master/src/sizes.rs

It seems like min_const_generic_args could be the missing compiler feature we need to be able to use the associated constant typenum::Unsigned::USIZE as N for [T; N] when defining our Array type.

It would be good to try to make this work on nightly in a proof-of-concept capacity to ensure it will actually work for our use cases. It would also make a compelling use case for min_const_generic_args.

cc @BoxyUwU

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Read src/sizes.rs first to understand the current fixed-size macro approach, then review the nightly min_generic_const_args goal. Build a proof of concept using typenum::Unsigned::USIZE as N for the Array type; done means arbitrary sizes work for the relevant use cases and the approach is confirmed viable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.