Skip to content

Commit f054cbd

Browse files
committed
paused
1 parent ce4d210 commit f054cbd

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6735,7 +6735,7 @@ ERROR(availability_isolated_any_only_version_newer, none,
67356735
"%0 %1 or newer",
67366736
(StringRef, llvm::VersionTuple))
67376737

6738-
ERROR(availability_noncopyable_generics_only_version_newer, none,
6738+
WARNING(availability_noncopyable_generics_only_version_newer, none,
67396739
"runtime support for '~' suppressions on generic parameters is only available in "
67406740
"%0 %1 or newer",
67416741
(StringRef, llvm::VersionTuple))

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,6 +3026,13 @@ static bool diagnoseIsolatedAnyAvailability(
30263026

30273027
static bool diagnoseNoncopyableGenericsAvailability(
30283028
SourceRange ReferenceRange, const DeclContext *ReferenceDC) {
3029+
// Do not check availability in the stdlib.
3030+
// FIXME: would be better if we had an attribute on each decl that opt's out
3031+
// of availability checking in the stdlib, because it's been audited or
3032+
// automatically checked to ensure it doesn't use the metadata.
3033+
// if (ReferenceDC->getParentModule()->isStdlibModule())
3034+
// return false;
3035+
30293036
return TypeChecker::checkAvailability(
30303037
ReferenceRange,
30313038
ReferenceDC->getASTContext().getNoncopyableGenericsAvailability(),
@@ -3044,6 +3051,7 @@ static bool inverseGenericsOldRuntimeCompatable(BoundGenericType *boundTy) {
30443051
case InvertibleProtocolKind::Copyable:
30453052
if (arg->isNoncopyable())
30463053
return false;
3054+
break;
30473055
case InvertibleProtocolKind::Escapable:
30483056
if (!arg->isEscapable())
30493057
return false;
@@ -3088,8 +3096,12 @@ static bool checkTypeMetadataAvailabilityInternal(CanType type,
30883096
auto isolation = fnType->getIsolation();
30893097
if (isolation.isErased())
30903098
return diagnoseIsolatedAnyAvailability(refLoc, refDC);
3091-
} else if (auto nominalTy = dyn_cast<NominalOrBoundGenericNominalType>(type)) {
3092-
if (requiresNoncopyableGenericsAvailabilityCheck(nominalTy))
3099+
// } else if (auto nominalTy = dyn_cast<NominalOrBoundGenericNominalType>(type)) {
3100+
// if (requiresNoncopyableGenericsAvailabilityCheck(nominalTy))
3101+
// return diagnoseNoncopyableGenericsAvailability(refLoc, refDC);
3102+
//// llvm_unreachable("did hit this case!");
3103+
} else if (auto archeType = dyn_cast<ArchetypeType>(type)) {
3104+
if (archeType->isNoncopyable())
30933105
return diagnoseNoncopyableGenericsAvailability(refLoc, refDC);
30943106
}
30953107
return false;

0 commit comments

Comments
 (0)