-
Notifications
You must be signed in to change notification settings - Fork 112
Acknowledge unsafe API usages in code expanded from testing library macros #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…acros Fixes: rdar://151238560
@swift-ci please test |
This fails to build when using a pre-6.2 toolchain because those toolchains don't recognize the |
Can we conditionally mark the |
…ry-safety only on newer toolchains and only attempting to include the relevant test code in that situation
…tions by (conditionally) marking them `@safe` when using a new-enough compiler
… 'unsafe' expression keyword is included. This expands the scope of a similar fix made earlier.
Yes, I've gone ahead and done that, and removed the relevant |
OK I've adjusted the PR to only include the With this and some other adjustments, I am now able to build the package locally using a 6.1 toolchain successfully. |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
Acknowledge unsafe API usages from various testing library macros such as
@Test
,@Suite
, and#expect(processExitsWith:)
which are revealed in modules which enable the new opt-in strict memory safety feature in Swift 6.2.Motivation:
This fix allows clients of the testing library to enable SE-0458: Opt-in Strict Memory Safety Checking if they wish and avoid diagnostics from the testing library macros in their modules. These warnings generally looked like this, before this fix:
Modifications:
TestingTests
.unsafe
keyword in the appropriate places in our macros to acknowledge the existing unsafe usages.Checklist:
Fixes: rdar://151238560