Skip to content

Commit d3bd4c5

Browse files
authored
Merge pull request #20812 from milseman/sliced_guts
2 parents a8ce65b + e44972d commit d3bd4c5

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

stdlib/public/core/StringGutsSlice.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@
1616

1717
// A sliced _StringGuts, convenient for unifying String/Substring comparison,
1818
// hashing, and RRC.
19-
@_fixed_layout
20-
@usableFromInline
2119
internal struct _StringGutsSlice {
22-
@usableFromInline
2320
internal var _guts: _StringGuts
2421

25-
@usableFromInline
2622
internal var _offsetRange: Range<Int>
2723

28-
@inlinable @inline(__always)
24+
@inline(__always)
2925
internal init(_ guts: _StringGuts) {
3026
self._guts = guts
3127
self._offsetRange = 0..<self._guts.count
3228
}
3329

34-
@inlinable @inline(__always)
30+
@inline(__always)
3531
internal init(_ guts: _StringGuts, _ offsetRange: Range<Int>) {
3632
self._guts = guts
3733
self._offsetRange = offsetRange
@@ -83,7 +79,7 @@ internal struct _StringGutsSlice {
8379
}
8480
}
8581

86-
@inlinable @inline(__always)
82+
@inline(__always)
8783
internal func withFastUTF8<R>(
8884
_ f: (UnsafeBufferPointer<UInt8>) throws -> R
8985
) rethrows -> R {

stdlib/public/core/StringHashable.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extension StringProtocol {
4545
}
4646

4747
extension _StringGutsSlice {
48-
@usableFromInline // @opaque
4948
@inline(never) // slow-path
5049
internal func _normalizedHash(into hasher: inout Hasher) {
5150
if self.isNFCFastUTF8 {

stdlib/public/core/StringProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ extension StringProtocol {
132132
get { return String(self) }
133133
}
134134

135-
@inlinable // Eliminate for String, Substring
136135
internal var _gutsSlice: _StringGutsSlice {
137136
@_specialize(where Self == String)
138137
@_specialize(where Self == Substring)
@@ -152,7 +151,8 @@ extension StringProtocol {
152151
@inline(__always) get {
153152
let start = startIndex
154153
let end = endIndex
155-
_internalInvariant(start.transcodedOffset == 0 && end.transcodedOffset == 0)
154+
_internalInvariant(
155+
start.transcodedOffset == 0 && end.transcodedOffset == 0)
156156
return Range(uncheckedBounds: (start.encodedOffset, end.encodedOffset))
157157
}
158158
}

test/api-digester/Outputs/stability-stdlib-abi.swift.expected

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,23 @@ Protocol _NSEnumerator has been removed
483483
Protocol _NSFastEnumeration has been removed
484484
Protocol _ShadowProtocol has been removed
485485

486+
Constructor _StringGutsSlice.init(_:) has been removed
487+
Constructor _StringGutsSlice.init(_:_:) has been removed
488+
Func _StringGutsSlice._normalizedHash(into:) has been removed
489+
Func _StringGutsSlice.compare(with:expecting:) has been removed
490+
Func _StringGutsSlice.withFastUTF8(_:) has been removed
491+
Struct _StringGutsSlice is now without @_fixed_layout
492+
Var StringProtocol._gutsSlice has been removed
493+
Var _StringGutsSlice._guts has been removed
494+
Var _StringGutsSlice._offsetRange has been removed
495+
Var _StringGutsSlice.count has been removed
496+
Var _StringGutsSlice.end has been removed
497+
Var _StringGutsSlice.isASCII has been removed
498+
Var _StringGutsSlice.isFastUTF8 has been removed
499+
Var _StringGutsSlice.isNFCFastUTF8 has been removed
500+
Var _StringGutsSlice.range has been removed
501+
Var _StringGutsSlice.start has been removed
502+
486503
Func ManagedBufferPointer._sanityCheckValidBufferClass(_:creating:) has been removed
487504
Func _sanityCheck(_:_:file:line:) has been removed
488505
Func _sanityCheckFailure(_:file:line:) has been removed

0 commit comments

Comments
 (0)