Fix the two stdlib breakages blocking every mojo-redis build - #5
Merged
Conversation
Both the test and docs workflows have failed since the repo was published -- neither has ever been green -- and both fail on the same two errors. InlineArray no longer conforms to ImplicitlyCopyable, so returning the local `octets` out of _parse_ipv4 needs an explicit transfer. The value is dead after the return, so `^` is right; `.copy()` would add a needless copy of 4 bytes. UnsafePointer split safe and unsafe variants, and `__add__` now carries a `where Self._is_unsafe` constraint that List.unsafe_ptr()'s return type does not satisfy. `unsafe_offset` is the same operation with no such constraint -- it is what `__add__` itself forwards to -- so the pointer arithmetic is unchanged in behaviour. Leaves the init_pointee_copy deprecation warnings alone; they are warnings, not errors, and swapping them for unsafe_write is a separate change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unlike the other mojo repos, mojo-redis is not recent nightly drift — neither workflow has ever been green, going back to the 7/29 publish. Both
testanddocsfail on the same two errors, so this fixes both.1.
src/redis/connection.mojo:97—InlineArrayis no longerImplicitlyCopyableoctetsis dead after the return, so^is the right call — the compiler's other suggestion,.copy(), would add a pointless 4-byte copy.2.
src/redis/connection.mojo:201— pointer arithmetic now requires an unsafe pointerUnsafePointersplit into safe and unsafe variants, and__add__gained awhere Self._is_unsafeconstraint thatList.unsafe_ptr()'s return type doesn't satisfy.unsafe_offsetis the identical operation without the constraint —__add__literally forwards to it (unsafe_pointer.mojo:827) — so behaviour is unchanged.Not addressed here: the
init_pointee_copy→unsafe_writedeprecation warnings. They're warnings, don't fail the build, and are a separate change.🤖 Generated with Claude Code