Skip to content

Commit 6b7d316

Browse files
committed
[string] Fix 32-bit small string compilation failure
1 parent 4a368ab commit 6b7d316

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/core/SmallString.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,15 @@ extension _SmallUTF8String {
157157
@inlinable
158158
public // @testable
159159
init?(_ scalar: Unicode.Scalar) {
160+
#if arch(i386) || arch(arm)
161+
return nil // Never form small strings on 32-bit
162+
#else
160163
// FIXME: support transcoding
161164
guard scalar.value <= 0x7F else { return nil }
162165
self.init()
163166
self.count = 1
164167
self[0] = UInt8(truncatingIfNeeded: scalar.value)
168+
#endif
165169
}
166170
}
167171

0 commit comments

Comments
 (0)