Skip to content

Commit 81bde88

Browse files
committed
[Release Notes] Issue #64927: Constrain implicit raw pointer
conversion to bitwise-copyable values (cherry picked from commit 1328df1)
1 parent 888b269 commit 81bde88

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
44

55
## Swift 5.9
66

7+
* [#64927][]:
8+
9+
Swift 5.9 introduces warnings that catch conversions from an inout
10+
argument in the caller to an `UnsafeRawPointer` in the callee
11+
whenever the original type contains an object reference.
12+
13+
```swift
14+
func inspectString(string: inout String) {
15+
readBytes(&string)
16+
// warning: forming an 'UnsafeRawPointer' to an inout variable of type String
17+
// exposes the internal representation rather than the string contents.
18+
}
19+
```
20+
21+
```swift
22+
func inspectData(data: inout Data) {
23+
readBytes(&data)
24+
// warning: forming an 'UnsafeRawPointer' to a variable of type 'T';
25+
// this is likely incorrect because 'T' may contain an object reference.
26+
}
27+
```
28+
29+
Please see the "Workarounds for common cases" section link in github
30+
issue #64927.
31+
732
* Marking stored properties as unavailable with `@available` has been banned,
833
closing an unintentional soundness hole that had allowed arbitrary
934
unavailable code to run and unavailable type metadata to be used at runtime:
@@ -9705,6 +9730,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
97059730
[SE-0376]: <https://github.com/apple/swift-evolution/blob/main/proposals/0376-function-back-deployment.md>
97069731
[SE-0377]: <https://github.com/apple/swift-evolution/blob/main/proposals/0377-parameter-ownership-modifiers.md>
97079732

9733+
[#64927]: <https://github.com/apple/swift/issues/64927>
97089734
[#42697]: <https://github.com/apple/swift/issues/42697>
97099735
[#42728]: <https://github.com/apple/swift/issues/42728>
97109736
[#43036]: <https://github.com/apple/swift/issues/43036>

0 commit comments

Comments
 (0)