Skip to content

Commit a121069

Browse files
committed
stdlib: Mark some deprecated corelibs-foundation SPI that are no longer used as unavailable
This keeps them around in the ABI while preventing actual usage as we build up confidence to finally remove them.
1 parent bf9b4e3 commit a121069

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

stdlib/public/core/StringGuts.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,28 +407,28 @@ extension _StringGuts {
407407
return !isSmall && isFastUTF8 && isASCII
408408
}
409409

410-
@available(*, deprecated)
411-
public // SPI(corelibs-foundation)
412-
var _isContiguousUTF16: Bool {
410+
// FIXME: Previously used by swift-corelibs-foundation. Aging for removal.
411+
@available(*, unavailable)
412+
public var _isContiguousUTF16: Bool {
413413
return false
414414
}
415415

416-
// FIXME: Remove. Still used by swift-corelibs-foundation
416+
// FIXME: Mark as obsoleted. Still used by swift-corelibs-foundation.
417417
@available(*, deprecated)
418418
public var startASCII: UnsafeMutablePointer<UInt8> {
419419
return UnsafeMutablePointer(mutating: _object.fastUTF8.baseAddress!)
420420
}
421421

422-
// FIXME: Remove. Still used by swift-corelibs-foundation
423-
@available(*, deprecated)
422+
// FIXME: Previously used by swift-corelibs-foundation. Aging for removal.
423+
@available(*, unavailable)
424424
public var startUTF16: UnsafeMutablePointer<UTF16.CodeUnit> {
425425
fatalError("Not contiguous UTF-16")
426426
}
427427
}
428428

429-
@available(*, deprecated)
430-
public // SPI(corelibs-foundation)
431-
func _persistCString(_ p: UnsafePointer<CChar>?) -> [CChar]? {
429+
// FIXME: Previously used by swift-corelibs-foundation. Aging for removal.
430+
@available(*, unavailable)
431+
public func _persistCString(_ p: UnsafePointer<CChar>?) -> [CChar]? {
432432
guard let s = p else { return nil }
433433
let bytesToCopy = UTF8._nullCodeUnitOffset(in: s) + 1 // +1 for the terminating NUL
434434
let result = [CChar](unsafeUninitializedCapacity: bytesToCopy) { buf, initedCount in

test/api-digester/stability-stdlib-abi-without-asserts.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,11 @@ Func UnsafePointer.withMemoryRebound(to:capacity:_:) has been removed
9494
Func UnsafeMutableRawBufferPointer.storeBytes(of:toByteOffset:as:) has been removed
9595
Func UnsafeMutableRawPointer.storeBytes(of:toByteOffset:as:) has been removed
9696

97+
// These haven't actually been removed; they are simply marked unavailable.
98+
// This seems to be a false positive in the ABI checker. This is not an ABI
99+
// break because the symbols are still present.
100+
Var _StringGuts._isContiguousUTF16 has been removed
101+
Var _StringGuts.startUTF16 has been removed
102+
Func _persistCString(_:) has been removed
103+
97104
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

0 commit comments

Comments
 (0)