Repository navigation
str.byte_at and str.slice are declared in the standard library and their built-ins are deleted; every str method is now a library declaration (#3483) - #3507
Merged
Conversation
…eir built-ins are deleted; every str method is now a library declaration (#3483)
This was referenced Nov 21, 2026
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.
Part of #3483 (D110).
str.byte_atandstr.sliceare declared in std.string over the runtime functions their built-ins called (with_str_byte_at_ref,with_str_slice_ref). The compiler's own sources call both throughout, so the compiler building itself is the widest test of the move.Deleted from the compiler (about 110 lines): the entries in
builtin_method_intrinsicand the name-based return-type table, twoBuiltinSigsrows, theMirIntrinsicandCcBuiltinmembers, the arms in the LLVM and C code generators, and a special case in the MIR validator that existed only for these two (an index argument that is an unmaterialized view, #2023). That hazard is now covered by the validator's rule for an ordinary call, andmir_test_call_unmaterialized_viewtests it that way.Tests:
behav_3483_str_byte_at_and_slice_declared(a call, at compile time, as a method value, on a view, in a pipeline, clamped and empty ranges), no leaks under the debug allocator; the C-backend tests pass.err_2358_builtin_extra_argnow usesrotate_left, which is still built in.With this, no
strmethod is a built-in: thirteen have moved (two onList, eleven onstr). Left: the rest ofList, the maps,Option/Result, the numeric methods, channels; then the freeze door and the method-value adapter are deleted.Battery green;
:release-checksgreen.