Fix @inlinable deinit incompatibility with library evolution

The `Storage` classes in HashTreeCollections and SortedCollections mark
their `deinit` as `@inlinable` but lack `@_fixed_layout`. Under library
evolution (BUILD_LIBRARY_FOR_DISTRIBUTION=YES), Swift 6.2+ rejects this
with "deinitializer can only be '@inlinable' if the class is
'@_fixed_layout'", because inlining a deinit requires a known layout that
resilient mode deliberately hides.

This mirrors the existing fix already applied to the equivalent storage
classes in DequeModule (_DequeBuffer) and RopeModule (Rope._Storage). As
noted there, this does not make anything ABI stable -- these storage
classes are @usableFromInline internal and never part of the public ABI
surface -- it only lets these modules build with library evolution
enabled.

Fixes #676.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Your NameandClaude Opus 4.8 committed 2026-06-29 16:15:00 +05:30
1 parent f5b320c29f
commit 259b4d52c2
2 files changed
+3 -1

No files matched your search

@@ -37,6 +37,7 @@ extension _HashNode {
/// Instances of this class hold (tail-allocated) storage for individual
/// nodes in a hash tree.
@usableFromInline
@_fixed_layout // Not really! This module isn't ABI stable.
internal final class Storage: _RawHashStorage {
@usableFromInline
internal typealias Element = (key: Key, value: Value)