@@ -53,6 +53,7 @@ extension String {
53
53
54
54
@inlinable
55
55
@_alwaysEmitIntoClient
56
+ @available ( swift, deprecated: 6 , message: " Use String(decoding: array, as: UTF8.self) instead " )
56
57
public init ( cString nullTerminatedUTF8: [ CChar ] ) {
57
58
self = nullTerminatedUTF8. withUnsafeBufferPointer {
58
59
$0. withMemoryRebound ( to: UInt8 . self, String . init ( _checkingCString: ) )
@@ -99,6 +100,7 @@ extension String {
99
100
100
101
@inlinable
101
102
@_alwaysEmitIntoClient
103
+ @available ( swift, deprecated: 6 , message: " Use String(decoding: array, as: UTF8.self) instead " )
102
104
public init ( cString nullTerminatedUTF8: [ UInt8 ] ) {
103
105
self = nullTerminatedUTF8. withUnsafeBufferPointer {
104
106
String ( _checkingCString: $0)
@@ -200,6 +202,7 @@ extension String {
200
202
201
203
@inlinable
202
204
@_alwaysEmitIntoClient
205
+ @available ( swift, deprecated: 6 , message: " Use String(validating: array, as: UTF8.self) instead " )
203
206
public init ? ( validatingCString nullTerminatedUTF8: [ CChar ] ) {
204
207
guard let length = nullTerminatedUTF8. firstIndex ( of: 0 ) else {
205
208
_preconditionFailure (
@@ -215,7 +218,7 @@ extension String {
215
218
216
219
@inlinable
217
220
@_alwaysEmitIntoClient
218
- @available ( swift, deprecated: 6 , renamed : " String.init(validatingCString:) " )
221
+ @available ( swift, deprecated: 6 , message : " Use String(validating: array, as: UTF8.self) instead " )
219
222
public init ? ( validatingUTF8 cString: [ CChar ] ) {
220
223
self . init ( validatingCString: cString)
221
224
}
@@ -423,6 +426,7 @@ extension String {
423
426
@_specialize ( where Encoding == Unicode. UTF16 )
424
427
@inlinable // Fold away specializations
425
428
@_alwaysEmitIntoClient
429
+ @available ( swift, deprecated: 6 , message: " Use String(decoding: array, as: Encoding.self) instead " )
426
430
public init < Encoding: Unicode . Encoding > (
427
431
decodingCString nullTerminatedCodeUnits: [ Encoding . CodeUnit ] ,
428
432
as sourceEncoding: Encoding . Type
0 commit comments