Skip to content

API Breaking Change: remove arity parameters in favor of const generic - #5

Closed
compenguy wants to merge 5 commits into
masterfrom
const-arity
Closed

compenguy wants to merge 5 commits into
masterfrom
const-arity

Conversation

@compenguy

Copy link
Copy Markdown
Owner

Ensure matching arity of structs at the type level by encoding as a const generic on the struct.

Missing from this change is:

  • insurance that the arity isn't zero (blocked on some std::num::NonZero* work to make it work with const generics)
  • simplify basic usage a little by providing a default ARITY of 2 (blocked on rust issue #44580 default values for const generic parameters are experimental)

The first change would be compatibility breaking, the second is not (pretty sure, anyway).

@compenguy

Copy link
Copy Markdown
Owner Author

Rejecting this PR because:

  1. it complicates the API, requiring specifying generic parameters and lacks the clarity of a named method
  2. it appears to have a negative performance impact

I'm willing to reconsider someone is willing to invest some effort in mitigating some of these issues.

@compenguy compenguy closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants