Skip to content

Commit 1859ae4

Browse files
committed
[test] Internalize SmallString; NFC
1 parent 1a1f174 commit 1859ae4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

stdlib/public/core/SmallString.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func unsupportedOn32bit() -> Never { _conditionallyUnreachable() }
3131

3232
#else
3333
@_fixed_layout
34-
public // @testable
35-
struct _SmallUTF8String {
34+
@usableFromInline
35+
internal struct _SmallUTF8String {
3636
@usableFromInline
3737
typealias _RawBitPattern = (low: UInt, high: UInt)
3838

@@ -61,12 +61,11 @@ struct _SmallUTF8String {
6161
//
6262
extension _SmallUTF8String {
6363
@inlinable
64-
public // @testable
65-
static var capacity: Int { return 15 }
64+
static internal var capacity: Int { return 15 }
6665

6766
#if _runtime(_ObjC)
68-
public // @testable
69-
init?(_cocoaString cocoa: _CocoaString) {
67+
@usableFromInline
68+
internal init?(_cocoaString cocoa: _CocoaString) {
7069
#if arch(i386) || arch(arm)
7170
return nil // Never form small strings on 32-bit
7271
#else
@@ -89,8 +88,7 @@ extension _SmallUTF8String {
8988
#endif // _runtime(_ObjC)
9089

9190
@inlinable
92-
public // @testable
93-
init?<C: RandomAccessCollection>(_ codeUnits: C) where C.Element == UInt16 {
91+
internal init?<C: RandomAccessCollection>(_ codeUnits: C) where C.Element == UInt16 {
9492
#if arch(i386) || arch(arm)
9593
return nil // Never form small strings on 32-bit
9694
#else

test/stdlib/SmallString.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %target-run-simple-swift
1+
// RUN: %target-build-swift -Xfrontend -disable-access-control -module-name a %s -o %t.out -O
2+
// RUN: %target-run %t.out
3+
24
// REQUIRES: executable_test
35
// REQUIRES: objc_interop
46
// REQUIRES: CPU=arm64 || CPU=x86_64

0 commit comments

Comments
 (0)