Skip to content

Commit d5e3e94

Browse files
committed
AST: Make $UnsafeInheritExecutor a baseline feature.
It has been available since at least Swift 5.8.
1 parent bb416e1 commit d5e3e94

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ LANGUAGE_FEATURE(NewCxxMethodSafetyHeuristics, 0, "Only import C++ methods that
145145
SUPPRESSIBLE_LANGUAGE_FEATURE(SpecializeAttributeWithAvailability, 0, "@_specialize attribute with availability")
146146
BASELINE_LANGUAGE_FEATURE(BuiltinAssumeAlignment, 0, "Builtin.assumeAlignment")
147147
BASELINE_LANGUAGE_FEATURE(BuiltinCreateTaskGroupWithFlags, 0, "Builtin.createTaskGroupWithFlags")
148-
SUPPRESSIBLE_LANGUAGE_FEATURE(UnsafeInheritExecutor, 0, "@_unsafeInheritExecutor")
148+
BASELINE_LANGUAGE_FEATURE(UnsafeInheritExecutor, 0, "@_unsafeInheritExecutor")
149149
SUPPRESSIBLE_LANGUAGE_FEATURE(PrimaryAssociatedTypes2, 346, "Primary associated types")
150150
SUPPRESSIBLE_LANGUAGE_FEATURE(UnavailableFromAsync, 0, "@_unavailableFromAsync")
151151
SUPPRESSIBLE_LANGUAGE_FEATURE(NoAsyncAvailability, 340, "@available(*, noasync)")

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,14 +3027,6 @@ static void suppressingFeatureSpecializeAttributeWithAvailability(
30273027
action();
30283028
}
30293029

3030-
static void suppressingFeatureUnsafeInheritExecutor(PrintOptions &options,
3031-
llvm::function_ref<void()> action) {
3032-
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
3033-
options.ExcludeAttrList.push_back(DeclAttrKind::UnsafeInheritExecutor);
3034-
action();
3035-
options.ExcludeAttrList.resize(originalExcludeAttrCount);
3036-
}
3037-
30383030
static void suppressingFeaturePrimaryAssociatedTypes2(PrintOptions &options,
30393031
llvm::function_ref<void()> action) {
30403032
bool originalPrintPrimaryAssociatedTypes = options.PrintPrimaryAssociatedTypes;

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ static bool usesFeatureSpecializeAttributeWithAvailability(Decl *decl) {
201201
return false;
202202
}
203203

204-
static bool usesFeatureUnsafeInheritExecutor(Decl *decl) {
205-
return decl->getAttrs().hasAttribute<UnsafeInheritExecutorAttr>();
206-
}
207-
208204
static bool usesFeaturePrimaryAssociatedTypes2(Decl *decl) {
209205
if (auto *protoDecl = dyn_cast<ProtocolDecl>(decl)) {
210206
if (protoDecl->getPrimaryAssociatedTypes().size() > 0)

test/ModuleInterface/features.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// RUN: --implicit-check-not "\$MarkerProtocol" \
99
// RUN: --implicit-check-not "\$Sendable" \
1010
// RUN: --implicit-check-not "\$InheritActorContext" \
11+
// RUN: --implicit-check-not "\$UnsafeInheritExecutor" \
1112
// RUN: < %t/FeatureTest.swiftinterface
1213

1314
// REQUIRES: concurrency
@@ -134,17 +135,16 @@ public func stage(with actor: MyActor) { }
134135
// CHECK: func asyncIsh
135136
public func asyncIsh(@_inheritActorContext operation: @Sendable @escaping () async -> Void) { }
136137

137-
// CHECK: #if compiler(>=5.3) && $UnsafeInheritExecutor
138138
// CHECK: @_unsafeInheritExecutor public func unsafeInheritExecutor() async
139139
@_unsafeInheritExecutor
140140
public func unsafeInheritExecutor() async {}
141141

142-
// CHECK: #elseif compiler(>=5.3) && $SpecializeAttributeWithAvailability
142+
// CHECK: #if compiler(>=5.3) && $SpecializeAttributeWithAvailability
143143
// CHECK: @_specialize{{.*}}
144-
// CHECK: public func multipleSuppressible<T>(value: T) async
144+
// CHECK: public func unsafeInheritExecutorAndSpecialize<T>(value: T) async
145145
@_unsafeInheritExecutor
146146
@_specialize(exported: true, availability: SwiftStdlib 5.1, *; where T == Int)
147-
public func multipleSuppressible<T>(value: T) async {}
147+
public func unsafeInheritExecutorAndSpecialize<T>(value: T) async {}
148148

149149
// CHECK: #if compiler(>=5.3) && $UnavailableFromAsync
150150
// CHECK-NEXT: @_unavailableFromAsync(message: "Test") public func unavailableFromAsyncFunc()

0 commit comments

Comments
 (0)