We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b322e3 commit 696bbacCopy full SHA for 696bbac
stdlib/public/core/Builtin.swift
@@ -91,8 +91,11 @@ func _canBeClass<T>(_: T.Type) -> Int8 {
91
/// Returns: A new instance of type `U`, cast from `x`.
92
@inlinable // unsafe-performance
93
@_transparent
94
+@_preInverseGenerics
95
@unsafe
-public func unsafeBitCast<T, U>(_ x: T, to type: U.Type) -> U {
96
+public func unsafeBitCast<T: ~Escapable, U>(
97
+ _ x: T, to type: U.Type
98
+) -> U {
99
_precondition(MemoryLayout<T>.size == MemoryLayout<U>.size,
100
"Can't unsafeBitCast between types of different sizes")
101
return Builtin.reinterpretCast(x)
0 commit comments