@@ -4,6 +4,31 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
4
4
5
5
## Swift 5.9
6
6
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
+
7
32
* Marking stored properties as unavailable with ` @available ` has been banned,
8
33
closing an unintentional soundness hole that had allowed arbitrary
9
34
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
9705
9730
[SE- 0376 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0376-function-back-deployment.md>
9706
9731
[SE- 0377 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0377-parameter-ownership-modifiers.md>
9707
9732
9733
+ [#64927 ]: < https: // github.com/apple/swift/issues/64927>
9708
9734
[#42697 ]: < https: // github.com/apple/swift/issues/42697>
9709
9735
[#42728 ]: < https: // github.com/apple/swift/issues/42728>
9710
9736
[#43036 ]: < https: // github.com/apple/swift/issues/43036>
0 commit comments