Skip to content

Commit 5f977ca

Browse files
committed
NCGenerics: force module mismatches
1 parent a74eb6b commit 5f977ca

32 files changed

+34
-37
lines changed

include/swift/Basic/Features.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ EXPERIMENTAL_FEATURE(RawLayout, true)
237237
EXPERIMENTAL_FEATURE(Embedded, true)
238238

239239
/// Enables noncopyable generics
240-
EXPERIMENTAL_FEATURE(NoncopyableGenerics, false)
240+
EXPERIMENTAL_FEATURE(NoncopyableGenerics, true)
241241

242242
/// Allow destructuring stored `let` bindings in structs.
243243
EXPERIMENTAL_FEATURE(StructLetDestructuring, true)
244244

245245
/// Enable non-escapable type attributes and function attributes that support
246246
/// lifetime-dependent results.
247-
EXPERIMENTAL_FEATURE(NonescapableTypes, false)
247+
EXPERIMENTAL_FEATURE(NonescapableTypes, true)
248248

249249
// Infer Sendability of unapplied and partial applied methods,
250250
// global functions and key paths.

lib/Serialization/ModuleFileSharedCore.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,6 @@ static ValidationInfo validateControlBlock(
425425
break;
426426
}
427427
case control_block::HAS_NONCOPYABLE_GENERICS: {
428-
// FIXME: temporary hack until the stdlib is actually building.
429-
// This skips over the module mismatch error if the stdlib wasn't built
430-
// with noncopyable generics, so that tests may still run in CI.
431-
if (!SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS)
432-
break;
433-
434428
auto hasNoncopyableGenerics = scratch[0];
435429
if (requiresNoncopyableGenerics && !hasNoncopyableGenerics)
436430
result.status = Status::NotUsingNoncopyableGenerics;
@@ -1829,4 +1823,3 @@ ModuleFileSharedCore::getTransitiveLoadingBehavior(
18291823
// By default, imports are required dependencies.
18301824
return ModuleLoadingBehavior::Required;
18311825
}
1832-

lib/Serialization/ModuleFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5858
/// describe what change you made. The content of this comment isn't important;
5959
/// it just ensures a conflict if two people change the module format.
6060
/// Don't worry about adhering to the 80-column limit for this line.
61-
const uint16_t SWIFTMODULE_VERSION_MINOR = 845; // borrowing var introducer
61+
const uint16_t SWIFTMODULE_VERSION_MINOR = 846; // always trigger mismatch for NoncopyableGenerics
6262

6363
/// A standard hash seed used for all string hashes in a serialized module.
6464
///

test/Generics/inverse_copyable_requirement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -enable-experimental-feature NoncopyableGenerics
22

3-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
44

55
// a concrete move-only type
66
struct MO: ~Copyable {

test/Generics/inverse_generics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -enable-experimental-feature NoncopyableGenerics -enable-experimental-feature NonescapableTypes
22

3-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
44

55
// Check support for explicit conditional conformance
66
public struct ExplicitCond<T: ~Copyable>: ~Copyable {}

test/Generics/inverse_generics_stdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -parse-stdlib -module-name Swift -enable-experimental-feature BuiltinModule -enable-experimental-feature NoncopyableGenerics -enable-experimental-feature NonescapableTypes
22

3-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
44

55
/// This test specifically covers constructs that are only valid in the stdlib.
66

test/Generics/inverse_protocols.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -enable-experimental-feature NoncopyableGenerics
22

3-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
44

55
protocol Eq: ~Copyable {
66
func same(as: borrowing Self) -> Bool

test/Generics/inverse_protocols_errors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -enable-experimental-feature NoncopyableGenerics
22

3-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
44

55
protocol RegularProto {}
66
protocol NCProto: RegularProto

test/Generics/inverse_rdar119950540.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %target-swift-frontend %s -emit-silgen -enable-experimental-feature NoncopyableGenerics > /dev/null
22

3-
// For -enable-experimental-feature NoncopyableGenerics
4-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
54

65
public protocol MyIteratorProtocol<Element> {
76
associatedtype Element

test/Generics/inverse_scoping.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -enable-experimental-feature NoncopyableGenerics -enable-experimental-feature NonescapableTypes
22

3-
// REQUIRES: asserts
3+
// REQUIRES: noncopyable_generics
44

55
protocol NoCopyReq: ~Copyable {}
66

0 commit comments

Comments
 (0)