Skip to content

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
ehartford merged 1 commit into
mainfrom
builtin-bodies-6
Nov 21, 2026
Merged

ehartford merged 1 commit into
mainfrom
builtin-bodies-6

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Part of #3483 (D110).

str.byte_at and str.slice are 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_intrinsic and the name-based return-type table, two BuiltinSigs rows, the MirIntrinsic and CcBuiltin members, 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, and mir_test_call_unmaterialized_view tests 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_arg now uses rotate_left, which is still built in.

With this, no str method is a built-in: thirteen have moved (two on List, eleven on str). Left: the rest of List, the maps, Option/Result, the numeric methods, channels; then the freeze door and the method-value adapter are deleted.

Battery green; :release-checks green.

…eir built-ins are deleted; every str method is now a library declaration (#3483)
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.

1 participant