@@ -1187,8 +1187,7 @@ class Classification {
1187
1187
Classification result;
1188
1188
bool considerAsync = !onlyEffect || *onlyEffect == EffectKind::Async;
1189
1189
bool considerThrows = !onlyEffect || *onlyEffect == EffectKind::Throws;
1190
- bool considerUnsafe = (!onlyEffect || *onlyEffect == EffectKind::Unsafe) &&
1191
- ctx.LangOpts .hasFeature (Feature::StrictMemorySafety);
1190
+ bool considerUnsafe = (!onlyEffect || *onlyEffect == EffectKind::Unsafe);
1192
1191
1193
1192
// If we're tracking "unsafe" effects, compute them here.
1194
1193
if (considerUnsafe) {
@@ -1708,8 +1707,7 @@ class ApplyClassifier {
1708
1707
!fnType->isAsync () &&
1709
1708
!E->isImplicitlyAsync () &&
1710
1709
!hasAnyConformances &&
1711
- (fnRef.getExplicitSafety () == ExplicitSafety::Safe ||
1712
- !ctx.LangOpts .hasFeature (Feature::StrictMemorySafety))) {
1710
+ fnRef.getExplicitSafety () == ExplicitSafety::Safe) {
1713
1711
return Classification ();
1714
1712
}
1715
1713
@@ -1928,7 +1926,6 @@ class ApplyClassifier {
1928
1926
// If the safety of the callee is unspecified, check the safety of the
1929
1927
// arguments specifically.
1930
1928
if (hasUnspecifiedSafety &&
1931
- ctx.LangOpts .hasFeature (Feature::StrictMemorySafety) &&
1932
1929
!(assumedSafeArguments && assumedSafeArguments->contains (E))) {
1933
1930
classifyApplyEffect (EffectKind::Unsafe);
1934
1931
}
@@ -4554,8 +4551,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
4554
4551
Ctx.Diags .diagnose (S->getForLoc (), diag::for_unsafe_without_unsafe)
4555
4552
.fixItInsert (insertionLoc, " unsafe " );
4556
4553
}
4557
- } else if (S->getUnsafeLoc ().isValid () &&
4558
- Ctx.LangOpts .hasFeature (Feature::StrictMemorySafety)) {
4554
+ } else if (S->getUnsafeLoc ().isValid ()) {
4559
4555
// Extraneous "unsafe" on the sequence.
4560
4556
Ctx.Diags .diagnose (S->getUnsafeLoc (), diag::no_unsafe_in_unsafe_for)
4561
4557
.fixItRemove (S->getUnsafeLoc ());
@@ -4600,9 +4596,6 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
4600
4596
}
4601
4597
4602
4598
void diagnoseRedundantUnsafe (UnsafeExpr *E) const {
4603
- if (!Ctx.LangOpts .hasFeature (Feature::StrictMemorySafety))
4604
- return ;
4605
-
4606
4599
// Silence this warning in the expansion of the _SwiftifyImport macro.
4607
4600
// This is a hack because it's tricky to determine when to insert "unsafe".
4608
4601
unsigned bufferID =
0 commit comments