stdlib: Address StrictMemorySafety warnings in String related code.

This commit is contained in:
Allan Shortlidge
2025-03-31 14:43:55 -07:00
parent b3038e6d81
commit 60e66f3613
6 changed files with 7 additions and 7 deletions

View File

@@ -236,7 +236,7 @@ extension _StringGuts {
_ body: (UnsafePointer<Int8>) throws -> Result
) rethrows -> Result {
_internalInvariant(!_object.isFastZeroTerminated)
return try String(self).utf8CString.withUnsafeBufferPointer {
return try unsafe String(self).utf8CString.withUnsafeBufferPointer {
let ptr = unsafe $0.baseAddress._unsafelyUnwrappedUnchecked
return try unsafe body(ptr)
}