@@ -53,6 +53,7 @@ extension String {
5353
5454 @inlinable
5555 @_alwaysEmitIntoClient
56+ @available ( swift, deprecated: 6 , message: " Use String(decoding: array, as: UTF8.self) instead " )
5657 public init ( cString nullTerminatedUTF8: [ CChar ] ) {
5758 self = nullTerminatedUTF8. withUnsafeBufferPointer {
5859 $0. withMemoryRebound ( to: UInt8 . self, String . init ( _checkingCString: ) )
@@ -99,6 +100,7 @@ extension String {
99100
100101 @inlinable
101102 @_alwaysEmitIntoClient
103+ @available ( swift, deprecated: 6 , message: " Use String(decoding: array, as: UTF8.self) instead " )
102104 public init ( cString nullTerminatedUTF8: [ UInt8 ] ) {
103105 self = nullTerminatedUTF8. withUnsafeBufferPointer {
104106 String ( _checkingCString: $0)
@@ -200,6 +202,7 @@ extension String {
200202
201203 @inlinable
202204 @_alwaysEmitIntoClient
205+ @available ( swift, deprecated: 6 , message: " Use String(validating: array, as: UTF8.self) instead " )
203206 public init ? ( validatingCString nullTerminatedUTF8: [ CChar ] ) {
204207 guard let length = nullTerminatedUTF8. firstIndex ( of: 0 ) else {
205208 _preconditionFailure (
@@ -215,7 +218,7 @@ extension String {
215218
216219 @inlinable
217220 @_alwaysEmitIntoClient
218- @available ( swift, deprecated: 6 , renamed : " String.init(validatingCString:) " )
221+ @available ( swift, deprecated: 6 , message : " Use String(validating: array, as: UTF8.self) instead " )
219222 public init ? ( validatingUTF8 cString: [ CChar ] ) {
220223 self . init ( validatingCString: cString)
221224 }
@@ -423,6 +426,7 @@ extension String {
423426 @_specialize ( where Encoding == Unicode. UTF16 )
424427 @inlinable // Fold away specializations
425428 @_alwaysEmitIntoClient
429+ @available ( swift, deprecated: 6 , message: " Use String(decoding: array, as: Encoding.self) instead " )
426430 public init < Encoding: Unicode . Encoding > (
427431 decodingCString nullTerminatedCodeUnits: [ Encoding . CodeUnit ] ,
428432 as sourceEncoding: Encoding . Type
0 commit comments