mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, it was possible to write Unsafe[Mutable]Pointer(x) and have Swift deduce the pointee type based on context. Since reinterpreting memory is a fundamentally type-unsafe operation, it's better to be explicit about conversions from Unsafe[Mutable]Pointer<T> to Unsafe[Mutable]Pointer<U>. This change is consistent with the move from reinterpretCast(x) to unsafeBitCast(x, T.self). Also, we've encoded the operations of explicitly adding or removing mutability as properties, so that adding mutability can be separated from wild reinterpretCast'ing, a much more severe form of unsafety. Swift SVN r21324
50 KiB
50 KiB