Skip to content

SlotMap's contains, is_empty and len family are declared in the library (part of #3483) - #3612

Merged
ehartford merged 1 commit into
mainfrom
builtins-next
Nov 25, 2026
Merged

ehartford merged 1 commit into
mainfrom
builtins-next

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Part of #3483; the issue stays open.

Six of SlotMap's methods are library declarations in lib/std/collections.with (impl[T] SlotMap[T]): contains, len, len32, len64, ulen32, is_empty. Each body is one call of the runtime function the code generator used to call by hand.

Deleted with them: the SLOTMAP_CONTAINS / SLOTMAP_LEN* intrinsic members, their arms in the LLVM code generator, their mappings in the C backend, the list entries in MirCore and CodegenTraits, the BuiltinSigs row, and the name-based return types in SemaCheck.

One thing the move showed: is_empty on a SlotMap had no declaration of its own and was derived from the built-in len. With len declared and is_empty not, the call reached MIR as a generic call with no contract. is_empty is declared too.

Still built in for SlotMap: new, insert, get, slot, remove, replace, get_disjoint, and SlotMapSlot's get / set. They move ownership in and out of the storage, which is the next step.

Evidence at 7687122: both compilers check the source; release build; :unit-return-review, :ceremony-census, :self-audit, :native-compile-error-tests, :behavior-tests green (14 tests use SlotMap, unchanged); battery green; :release-checks survey: all targets green.

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