You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid calling unsafeBitCast(_:to:) to cast C function pointers. (#967)
This PR replaces calls to `unsafeBitCast(_:to:)` (where the value being
cast is a C function pointer) with calls to an internal function that
checks that the value being cast is actually a C function pointer. This
is intended to make the code in question more self-documenting (by
making it clear what kind of cast is being performed.)
The function does then call `unsafeBitCast(_:to:)`, but it's in one
place only instead of many places—the call sites are all now
self-documenting.
Also fixed one place we're using `unsafeBitCast(_:to:)` to cast a
metatype where, as of Swift 6.1, we don't need to anymore.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
0 commit comments