Skip to content

Commit b6e995e

Browse files
committed
Only emit @unsafe warning when strict safety mode is enabled
1 parent 47f2159 commit b6e995e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4769,7 +4769,8 @@ swift::diagnoseConformanceAvailability(SourceLoc loc,
47694769
}
47704770

47714771
// Strict memory safety checking.
4772-
if (!where.getAvailability().allowsUnsafe()) {
4772+
if (!where.getAvailability().allowsUnsafe() &&
4773+
ctx.LangOpts.hasFeature(Feature::WarnUnsafe)) {
47734774
if (auto normalConf = dyn_cast<NormalProtocolConformance>(rootConf)) {
47744775
// @unchecked Sendable conformances are considered unsafe when complete
47754776
// checking is enabled.

0 commit comments

Comments
 (0)