File tree Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ extension String {
383
383
}
384
384
385
385
let storage = unsafe buffer. baseAddress . map {
386
- __SharedStringStorage (
386
+ unsafe __SharedStringStorage(
387
387
_mortal: $0,
388
388
countAndFlags: _StringObject. CountAndFlags (
389
389
count: buffer. startIndex. distance ( to: written) ,
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ extension _StringGuts {
236
236
_ body: ( UnsafePointer < Int8 > ) throws -> Result
237
237
) rethrows -> Result {
238
238
_internalInvariant ( !_object. isFastZeroTerminated)
239
- return try String ( self ) . utf8CString. withUnsafeBufferPointer {
239
+ return try unsafe String( self ) . utf8CString. withUnsafeBufferPointer {
240
240
let ptr = unsafe $0. baseAddress . _unsafelyUnwrappedUnchecked
241
241
return try unsafe body( ptr)
242
242
}
Original file line number Diff line number Diff line change @@ -982,7 +982,7 @@ extension _StringObject {
982
982
}
983
983
}
984
984
#endif
985
- return unsafe withSharedStorage { $0. start }
985
+ return unsafe withSharedStorage { unsafe $0. start }
986
986
}
987
987
988
988
@usableFromInline
Original file line number Diff line number Diff line change @@ -699,7 +699,7 @@ final internal class __SharedStringStorage
699
699
countAndFlags: _StringObject . CountAndFlags
700
700
) {
701
701
self . _owner = nil
702
- self . start = unsafe ptr
702
+ unsafe self. start = ptr
703
703
self . immortal = true
704
704
#if _pointerBitWidth(_64)
705
705
self . _countAndFlags = countAndFlags
@@ -728,7 +728,7 @@ final internal class __SharedStringStorage
728
728
) {
729
729
// ptr *must* be the start of an allocation
730
730
self . _owner = nil
731
- self . start = unsafe ptr
731
+ unsafe self. start = ptr
732
732
self . immortal = false
733
733
#if _pointerBitWidth(_64)
734
734
self . _countAndFlags = countAndFlags
Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ extension __SharedStringStorage {
312
312
@objc ( UTF8String)
313
313
@_effects ( readonly)
314
314
final internal func _utf8String( ) -> UnsafePointer < UInt8 > ? {
315
- return start
315
+ return unsafe start
316
316
}
317
317
318
318
@objc ( cStringUsingEncoding: )
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ extension String {
278
278
@_effects ( readonly) @_semantics ( " string.getUTF8CString " )
279
279
get {
280
280
if _fastPath ( _guts. isFastUTF8) {
281
- var result = unsafe _guts. withFastCChar { ContiguousArray ( $0) }
281
+ var result = unsafe _guts. withFastCChar { unsafe ContiguousArray( $0) }
282
282
result. append ( 0 )
283
283
return result
284
284
}
You can’t perform that action at this time.
0 commit comments