Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Sep 1, 2025

Impl'd for Array<T, U> and [T; N].

This is an alternative to #134, given the trouble we had in #131 with adding impls of core traits to [T; N] and the ensuing inference conflicts it can cause.

The safest thing we can do is define our own traits, and these traits bound on AssocArraySize so they're able to handle everything related to the array size themselves, making them generic around only T.

With this we can revert #134, which still has the potential to cause problems similar to #131. Using our own trait guarantees we won't break inference in existing code.

Impl'd for `Array<T, U>` and `[T; N]`.

This is an alternative to #134, given the trouble we had in #131 with
adding impls of core traits to `[T; N]` and the ensuing inference
conflicts it can cause.

The safest thing we can do is define our own traits, and these traits
bound on `AssocArraySize` so they're able to handle everything related
to the array size themselves, making them generic around only `T`.

With this we can revert #134, which still has the potential to cause
problems similar to #131. Using our own trait guarantees we won't break
inference in existing code.
@tarcieri tarcieri force-pushed the add-array-ref-and-mut-traits branch from 1dbbb2c to a8bd11f Compare September 1, 2025 16:40
@tarcieri tarcieri requested a review from newpavlov September 1, 2025 16:42
@tarcieri
Copy link
Member Author

tarcieri commented Sep 1, 2025

@newpavlov if this looks good to you, I'd like to merge this, revert #134 to prevent any future inference problems similar to #131, then cut a new major version and start updating... well, everything (including a new release of dbl)

@tarcieri tarcieri merged commit 0450c2b into master Sep 1, 2025
14 checks passed
@tarcieri tarcieri deleted the add-array-ref-and-mut-traits branch September 1, 2025 18:07
tarcieri added a commit that referenced this pull request Sep 1, 2025
This reverts commit 1e21e27 (#134)

To avoid any future inference problems like #131.

Instead #135 adds traits impl'd on `[T; N]` which provide equivalent
functionality.
tarcieri added a commit that referenced this pull request Sep 1, 2025
This reverts commit 1e21e27 (#134)

To avoid any future inference problems like #131.

Instead #135 adds traits impl'd on `[T; N]` which provide equivalent
functionality.
@tarcieri tarcieri mentioned this pull request Sep 1, 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