Skip to content

Commit d0513a7

Browse files
authored
Merge pull request #79665 from Azoy/value-generics-no-more-experiment
[AST] Make ValueGenerics feature always available
2 parents d75b7cd + 208c268 commit d0513a7

36 files changed

+42
-98
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8248,8 +8248,6 @@ ERROR(value_generic_unexpected,none,
82488248
"using value generic %0 here is not allowed", (Type))
82498249
ERROR(missing_value_generic_type,none,
82508250
"value generic %0 must have an explicit value type declared", (Identifier))
8251-
ERROR(value_generics_missing_feature,none,
8252-
"value generics require '-enable-experimental-feature ValueGenerics'", ())
82538251
ERROR(availability_value_generic_type_only_version_newer, none,
82548252
"values in generic types are only available in %0 %1 or newer",
82558253
(AvailabilityDomain, AvailabilityRange))

include/swift/Basic/Features.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ LANGUAGE_FEATURE(NonescapableTypes, /*IsAdoptable=*/false, 446,
251251
LANGUAGE_FEATURE(BuiltinEmplaceTypedThrows, /*IsAdoptable=*/false, 0,
252252
"Builtin.emplace typed throws")
253253
SUPPRESSIBLE_LANGUAGE_FEATURE(MemorySafetyAttributes, 458, "@unsafe attribute")
254+
LANGUAGE_FEATURE(ValueGenerics, 452, "Value generics feature (integer generics)")
254255

255256
// Swift 6
256257
UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
@@ -465,9 +466,6 @@ EXPERIMENTAL_FEATURE(ImportNonPublicCxxMembers, true)
465466
// Isolated deinit
466467
SUPPRESSIBLE_LANGUAGE_FEATURE(IsolatedDeinit, 371, "isolated deinit")
467468

468-
// Enable values in generic signatures, e.g. <let N: Int>
469-
EXPERIMENTAL_FEATURE(ValueGenerics, true)
470-
471469
// When a parameter has unspecified isolation, infer it as main actor isolated.
472470
EXPERIMENTAL_FEATURE(UnspecifiedMeansMainActorIsolated, false)
473471

lib/AST/RequirementMachine/RequirementMachineRequests.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,6 @@ InferredGenericSignatureRequest::evaluate(
825825
"Parsed an empty generic parameter list?");
826826

827827
for (auto *gpDecl : *gpList) {
828-
if (gpDecl->isValue() &&
829-
!gpDecl->getASTContext().LangOpts.hasFeature(Feature::ValueGenerics))
830-
gpDecl->diagnose(diag::value_generics_missing_feature);
831-
832828
auto *gpType = gpDecl->getDeclaredInterfaceType()
833829
->castTo<GenericTypeParamType>();
834830
genericParams.push_back(gpType);

test/ASTGen/decls.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11

22
// RUN: %empty-directory(%t)
3-
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ValueGenerics -enable-experimental-feature ParserASTGen \
3+
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ParserASTGen \
44
// RUN: | %sanitize-address > %t/astgen.ast
5-
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ValueGenerics \
5+
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency \
66
// RUN: | %sanitize-address > %t/cpp-parser.ast
77

88
// RUN: %diff -u %t/astgen.ast %t/cpp-parser.ast
99

10-
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-concurrency -enable-experimental-feature ValueGenerics -enable-experimental-feature ParserASTGen)
10+
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-concurrency -enable-experimental-feature ParserASTGen)
1111

1212
// REQUIRES: executable_test
1313
// REQUIRES: swift_swift_parser
1414
// REQUIRES: swift_feature_ParserASTGen
15-
// REQUIRES: swift_feature_ValueGenerics
1615

1716
// rdar://116686158
1817
// UNSUPPORTED: asan

test/DebugInfo/value-generics-embedded.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macos14 -emit-ir -g -enable-experimental-feature ValueGenerics -enable-experimental-feature Embedded -wmo -disable-availability-checking -o - | %FileCheck %s
1+
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macos14 -emit-ir -g -enable-experimental-feature Embedded -wmo -disable-availability-checking -o - | %FileCheck %s
22

33
// REQUIRES: OS=macosx
44

55
// REQUIRES: swift_feature_Embedded
6-
// REQUIRES: swift_feature_ValueGenerics
76

87
// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "InlineArray",{{.*}}size: 64{{.*}}elements: ![[ELTS:[0-9]+]], runtimeLang: DW_LANG_Swift, templateParams: ![[SLAB_PARAMS:[0-9]+]], identifier: "$es11InlineArrayVy$0_4main8MySpriteVGD", specification:
98
// CHECK-DAG: ![[SLAB_PARAMS]] = !{![[COUNT_PARAM:.*]], ![[ELEMENT_PARAM:.*]]}

test/DebugInfo/value-generics.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swift-frontend %s -emit-ir -g -enable-builtin-module -enable-experimental-feature ValueGenerics -disable-availability-checking -o - | %FileCheck %s
2-
3-
// REQUIRES: swift_feature_ValueGenerics
1+
// RUN: %target-swift-frontend %s -emit-ir -g -enable-builtin-module -disable-availability-checking -o - | %FileCheck %s
42

53
import Builtin
64

test/IRGen/array_type_layout.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -disable-availability-checking -enable-experimental-feature ValueGenerics %s | %FileCheck %s
2-
3-
// REQUIRES: swift_feature_ValueGenerics
1+
// RUN: %target-swift-frontend -emit-ir -disable-availability-checking %s | %FileCheck %s
42

53
struct VerySmallSlab<T> {
64
var inline: InlineArray<16, T?>

test/IRGen/builtin_vector_fixed_array.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %target-swift-frontend -emit-irgen -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-irgen -disable-availability-checking -enable-experimental-feature BuiltinModule %s | %FileCheck %s
22

33
// REQUIRES: swift_feature_BuiltinModule
4-
// REQUIRES: swift_feature_ValueGenerics
4+
55
import Builtin
66
import Swift
77

test/IRGen/existential-bitwise-borrowability.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %{python} %utils/chex.py < %s > %t/existential-bitwise-borrowability.swift
3-
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -enable-experimental-feature ValueGenerics -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/existential-bitwise-borrowability.swift | %FileCheck %t/existential-bitwise-borrowability.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
3+
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/existential-bitwise-borrowability.swift | %FileCheck %t/existential-bitwise-borrowability.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
44

55
// REQUIRES: swift_feature_RawLayout
6-
// REQUIRES: swift_feature_ValueGenerics
76

87
// Copyable existentials are bitwise-borrowable (because copyable types are
98
// always bitwise-borrowable if they're bitwise-takable, and only bitwise-takable

test/IRGen/loadable_by_address_reg2mem_fixed_array.sil

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// %target-swift-frontend %s -Xllvm -sil-print-after=loadable-address -import-objc-header %S/Inputs/large_c.h -c -o %t/t.o 2>&1 | %FileCheck %s
22

3-
// RUN: %target-swift-frontend %s -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule -Xllvm -sil-print-types -Xllvm -sil-print-after=loadable-address -c -o %t/t.o 2>&1 | %FileCheck %s
3+
// RUN: %target-swift-frontend %s -disable-availability-checking -enable-experimental-feature BuiltinModule -Xllvm -sil-print-types -Xllvm -sil-print-after=loadable-address -c -o %t/t.o 2>&1 | %FileCheck %s
44

55
// REQUIRES: swift_feature_BuiltinModule
6-
// REQUIRES: swift_feature_ValueGenerics
76

87
// wasm currently disables aggressive reg2mem
98
// UNSUPPORTED: wasm

0 commit comments

Comments
 (0)