Skip to content

Commit 40e853f

Browse files
committed
Use -strict-concurrency=minimal as the default for Swift 5.x mode.
Emulate the behavior of Swift 5.5/5.6 by default, using `-strict-concurrency=minimal`.
1 parent 40f4651 commit 40e853f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ namespace swift {
325325
bool UseMalloc = false;
326326

327327
/// Specifies how strict concurrency checking will be.
328-
StrictConcurrency StrictConcurrencyLevel = StrictConcurrency::Targeted;
328+
StrictConcurrency StrictConcurrencyLevel = StrictConcurrency::Minimal;
329329

330330
/// Enable experimental #assert feature.
331331
bool EnableExperimentalStaticAssert = false;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
703703
} else if (Args.hasArg(OPT_warn_concurrency)) {
704704
Opts.StrictConcurrencyLevel = StrictConcurrency::Complete;
705705
} else {
706-
// Default to "limited" checking in Swift 5.x.
707-
Opts.StrictConcurrencyLevel = StrictConcurrency::Targeted;
706+
// Default to minimal checking in Swift 5.x.
707+
Opts.StrictConcurrencyLevel = StrictConcurrency::Minimal;
708708
}
709709

710710
Opts.WarnImplicitOverrides =

test/Concurrency/strict_concurrency_minimal.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-typecheck-verify-swift -strict-concurrency=minimal
2+
// RUN: %target-typecheck-verify-swift
23
// REQUIRES: concurrency
34

45
class C1 { }

0 commit comments

Comments
 (0)