Skip to content

Commit bb13518

Browse files
authored
Merge pull request #67625 from xedin/enable-init-accessors-feature
[Frontend/NFC] SE-0400: Enable `InitAccessors` feature by default
2 parents 8510bdd + 2a0651e commit bb13518

14 files changed

+14
-48
lines changed

include/swift/Basic/Features.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ EXPERIMENTAL_FEATURE(NamedOpaqueTypes, false)
123123
EXPERIMENTAL_FEATURE(FlowSensitiveConcurrencyCaptures, false)
124124
EXPERIMENTAL_FEATURE(CodeItemMacros, false)
125125
EXPERIMENTAL_FEATURE(TupleConformances, false)
126-
EXPERIMENTAL_FEATURE(InitAccessors, false)
127126

128127
SUPPRESSIBLE_LANGUAGE_FEATURE(ExtensionMacroAttr, 0, "@attached(extension)", true)
129128

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3277,10 +3277,6 @@ static bool usesFeatureSymbolLinkageMarkers(Decl *decl) {
32773277
});
32783278
}
32793279

3280-
static bool usesFeatureInitAccessors(Decl *decl) {
3281-
return false;
3282-
}
3283-
32843280
static bool usesFeatureLayoutPrespecialization(Decl *decl) {
32853281
auto &attrs = decl->getAttrs();
32863282
return std::any_of(attrs.begin(), attrs.end(), [](auto *attr) {

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7356,9 +7356,7 @@ static bool parseAccessorIntroducer(Parser &P,
73567356
}
73577357
}
73587358

7359-
bool isInitAccessor = (P.Context.LangOpts.hasFeature(Feature::InitAccessors)
7360-
&& P.Tok.is(tok::kw_init));
7361-
if (!(P.Tok.is(tok::identifier) || isInitAccessor) ||
7359+
if (!(P.Tok.is(tok::identifier) || P.Tok.is(tok::kw_init)) ||
73627360
P.Tok.isEscapedIdentifier()) {
73637361
return true;
73647362
}

test/Interpreter/init_accessors.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-feature -Xfrontend InitAccessors) | %FileCheck %s
2-
// RUN: %target-run-simple-swift(-O -Xfrontend -enable-experimental-feature -Xfrontend InitAccessors) | %FileCheck %s
1+
// RUN: %target-run-simple-swift | %FileCheck %s
2+
// RUN: %target-run-simple-swift(-O) | %FileCheck %s
33

44
// REQUIRES: executable_test
5-
// REQUIRES: asserts
65

76
struct TestInit {
87
var x: Int

test/ModuleInterface/Observable.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -plugin-path %swift-host-lib-dir/plugins -disable-availability-checking -enable-experimental-feature InitAccessors
2+
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -plugin-path %swift-host-lib-dir/plugins -disable-availability-checking
33
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library -disable-availability-checking
44
// RUN: %FileCheck %s < %t/Library.swiftinterface
55

6-
// Asserts is required for '-enable-experimental-feature InitAccessors'.
7-
// REQUIRES: asserts
8-
96
// REQUIRES: swift_swift_parser
107
// REQUIRES: observation
118

test/SILOptimizer/init_accessor_definite_init_diagnostics.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-experimental-feature InitAccessors -enable-copy-propagation=requested-passes-only -emit-sil -primary-file %s -o /dev/null -verify
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -emit-sil -primary-file %s -o /dev/null -verify
42

53
struct Test1 {
64
var x: Int // expected-note {{variable defined here}}

test/SILOptimizer/init_accessor_raw_sil_lowering.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-experimental-feature InitAccessors -Xllvm -sil-print-after=definite-init -emit-sil -module-name assign_or_init_lowering %s -o /dev/null 2>&1 | %FileCheck %s
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-after=definite-init -emit-sil -module-name assign_or_init_lowering %s -o /dev/null 2>&1 | %FileCheck %s
42

53
protocol Storage<T> {
64
associatedtype T

test/SILOptimizer/init_accessors.sil

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all -definite-init -raw-sil-inst-lowering -enable-experimental-feature InitAccessors %s | %FileCheck %s
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-sil-opt -enable-sil-verify-all -definite-init -raw-sil-inst-lowering %s | %FileCheck %s
42

53
import Builtin
64
import Swift

test/SILOptimizer/init_accessors.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// RUN: %target-swift-frontend -enable-experimental-feature InitAccessors -primary-file %s -Onone -emit-sil \
1+
// RUN: %target-swift-frontend -primary-file %s -Onone -emit-sil \
22
// RUN: -Xllvm -sil-print-after=raw-sil-inst-lowering \
33
// RUN: -o /dev/null -module-name init_accessors 2>&1 | %FileCheck %s
44

5-
// REQUIRES: asserts
6-
75
class NSObject {}
86

97
struct TestInit {

test/Serialization/init_accessors.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
// RUN: %empty-directory(%t/sdk)
44
// RUN: split-file %s %t/src
55

6-
// REQUIRES: asserts
7-
86
// RUN: %target-swift-frontend -emit-module %t/src/PublicModule.swift \
97
// RUN: -module-name PublicModule -swift-version 5 \
10-
// RUN: -emit-module-path %t/sdk/PublicModule.swiftmodule \
11-
// RUN: -enable-experimental-feature InitAccessors
8+
// RUN: -emit-module-path %t/sdk/PublicModule.swiftmodule
129

1310
// RUN: %target-swift-frontend -typecheck %t/src/Client.swift \
14-
// RUN: -enable-experimental-feature InitAccessors \
1511
// RUN: -module-name Client -I %t/sdk
1612

1713
//--- PublicModule.swift

test/decl/var/init_accessors.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-feature InitAccessors
2-
3-
// REQUIRES: asserts
1+
// RUN: %target-typecheck-verify-swift
42

53
func test_empty_init_accessor() {
64
struct Test {

test/stdlib/Observation/Observable.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// REQUIRES: swift_swift_parser, executable_test
22

3-
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -enable-experimental-feature InitAccessors -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -Xfrontend -plugin-path -Xfrontend %swift-host-lib-dir/plugins)
3+
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -Xfrontend -plugin-path -Xfrontend %swift-host-lib-dir/plugins)
44

55
// Run this test via the swift-plugin-server
6-
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -enable-experimental-feature InitAccessors -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -Xfrontend -external-plugin-path -Xfrontend %swift-host-lib-dir/plugins#%swift-plugin-server)
7-
8-
// Asserts is required for '-enable-experimental-feature InitAccessors'.
9-
// REQUIRES: asserts
6+
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -Xfrontend -external-plugin-path -Xfrontend %swift-host-lib-dir/plugins#%swift-plugin-server)
107

118
// REQUIRES: observation
129
// REQUIRES: concurrency

test/stdlib/Observation/ObservableDiagnostics.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// REQUIRES: swift_swift_parser
22

3-
// RUN: %target-typecheck-verify-swift -disable-availability-checking -parse-as-library -enable-experimental-feature InitAccessors -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -plugin-path %swift-host-lib-dir/plugins
4-
5-
// Asserts is required for '-enable-experimental-feature InitAccessors'.
6-
// REQUIRES: asserts
3+
// RUN: %target-typecheck-verify-swift -disable-availability-checking -parse-as-library -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -plugin-path %swift-host-lib-dir/plugins
74

85
// REQUIRES: observation
96
// REQUIRES: concurrency

test/stdlib/Observation/ObservableDidSetWillSet.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// REQUIRES: swift_swift_parser, executable_test
22

3-
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -enable-experimental-feature InitAccessors -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -Xfrontend -plugin-path -Xfrontend %swift-host-lib-dir/plugins) | %FileCheck %s
4-
5-
// Asserts is required for '-enable-experimental-feature InitAccessors'.
6-
// REQUIRES: asserts
3+
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -enable-experimental-feature Macros -enable-experimental-feature ExtensionMacros -Xfrontend -plugin-path -Xfrontend %swift-host-lib-dir/plugins) | %FileCheck %s
74

85
// REQUIRES: observation
96
// REQUIRES: concurrency

0 commit comments

Comments
 (0)