@@ -2446,6 +2446,7 @@ bool swift::diagnoseExplicitUnavailability(SourceLoc loc,
2446
2446
auto proto = rootConf->getProtocol ()->getDeclaredInterfaceType ();
2447
2447
2448
2448
StringRef platform;
2449
+ auto behavior = DiagnosticBehavior::Unspecified;
2449
2450
switch (attr->getPlatformAgnosticAvailability ()) {
2450
2451
case PlatformAgnosticAvailabilityKind::Deprecated:
2451
2452
llvm_unreachable (" shouldn't see deprecations in explicit unavailability" );
@@ -2456,6 +2457,12 @@ bool swift::diagnoseExplicitUnavailability(SourceLoc loc,
2456
2457
// This was platform-specific; indicate the platform.
2457
2458
platform = attr->prettyPlatformString ();
2458
2459
break ;
2460
+ } else if (rootConf->getProtocol ()->isSpecificProtocol (
2461
+ KnownProtocolKind::Sendable) &&
2462
+ !ctx.LangOpts .isSwiftVersionAtLeast (6 )) {
2463
+ // Downgrade unavailable Sendable conformances to warnings prior to
2464
+ // Swift 6.
2465
+ behavior = DiagnosticBehavior::Warning;
2459
2466
}
2460
2467
LLVM_FALLTHROUGH;
2461
2468
@@ -2474,7 +2481,8 @@ bool swift::diagnoseExplicitUnavailability(SourceLoc loc,
2474
2481
EncodedDiagnosticMessage EncodedMessage (attr->Message );
2475
2482
diags.diagnose (loc, diag::conformance_availability_unavailable,
2476
2483
type, proto,
2477
- platform.empty (), platform, EncodedMessage.Message );
2484
+ platform.empty (), platform, EncodedMessage.Message )
2485
+ .limitBehavior (behavior);
2478
2486
2479
2487
switch (attr->getVersionAvailability (ctx)) {
2480
2488
case AvailableVersionComparison::Available:
0 commit comments