Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,6 @@ option(SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED
"Enable experimental distributed actors and functions"
FALSE)

option(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES
"Enable experimental NonescapableTypes"
FALSE)

option(SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING
"Enable experimental string processing"
FALSE)
Expand Down Expand Up @@ -1385,7 +1381,6 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
message(STATUS "Differentiable Programming Support: ${SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING}")
message(STATUS "Concurrency Support: ${SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY}")
message(STATUS "Distributed Support: ${SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED}")
message(STATUS "NonEscapableTypes Support: ${SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES}")
message(STATUS "String Processing Support: ${SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING}")
message(STATUS "Backtracing Support: ${SWIFT_ENABLE_BACKTRACING}")
message(STATUS "Unicode Support: ${SWIFT_STDLIB_ENABLE_UNICODE_DATA}")
Expand Down
5 changes: 0 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ normalize_boolean_spelling(SWIFT_ENABLE_SOURCEKIT_TESTS)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION)
normalize_boolean_spelling(SWIFT_ENABLE_MACCATALYST)
Expand Down Expand Up @@ -407,10 +406,6 @@ foreach(SDK ${SWIFT_SDKS})
list(APPEND LIT_ARGS "--param" "distributed")
endif()

if(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES)
list(APPEND LIT_ARGS "--param" "nonescapable_types")
endif()

if(SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING)
list(APPEND LIT_ARGS "--param" "string_processing")
endif()
Expand Down
158 changes: 79 additions & 79 deletions test/ModuleInterface/nonescapable_types.swift
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name Test -enable-experimental-feature NonescapableTypes
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name Test
// RUN: %FileCheck %s < %t.swiftinterface
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name Test -enable-experimental-feature NonescapableTypes
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name Test
// RUN: %FileCheck %s < %t.swiftinterface

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public protocol P : ~Escapable {
// CHECK: associatedtype A
// CHECK: }
// CHECK: #else
// CHECK: public protocol P {
// CHECK: associatedtype A
// CHECK: }
// CHECK: #endif
public protocol P: ~Escapable {
associatedtype A
}
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public protocol P : ~Escapable {
// CHECK: associatedtype A
// CHECK: }
// CHECK: #else
// CHECK: public protocol P {
// CHECK: associatedtype A
// CHECK: }
// CHECK: #endif
public protocol P: ~Escapable {
associatedtype A
}

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public struct X<T> : ~Swift.Escapable where T : ~Escapable {
// CHECK: }
// CHECK: #else
// CHECK: public struct X<T> {
// CHECK: }
// CHECK: #endif
public struct X<T: ~Escapable>: ~Escapable { }
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public struct X<T> : ~Swift.Escapable where T : ~Escapable {
// CHECK: }
// CHECK: #else
// CHECK: public struct X<T> {
// CHECK: }
// CHECK: #endif
public struct X<T: ~Escapable>: ~Escapable { }

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: extension Test.X {
// CHECK-NEXT: func f()
// CHECK: }
// CHECK: #else
// CHECK: extension Test.X {
// CHECK-NEXT: func f()
// CHECK: }
extension X where T: Escapable {
public func f() { }
}
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: extension Test.X {
// CHECK-NEXT: func f()
// CHECK: }
// CHECK: #else
// CHECK: extension Test.X {
// CHECK-NEXT: func f()
// CHECK: }
extension X where T: Escapable {
public func f() { }
}

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: extension Test.X where T : ~Escapable {
// CHECK: public func g(other: borrowing T)
// CHECK: }
// CHECK: #else
// CHECK: extension Test.X {
// CHECK: public func g(other: borrowing T)
// CHECK: }
// CHECK: #endif
extension X where T: ~Escapable {
public func g(other: borrowing T) { }
}
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: extension Test.X where T : ~Escapable {
// CHECK: public func g(other: borrowing T)
// CHECK: }
// CHECK: #else
// CHECK: extension Test.X {
// CHECK: public func g(other: borrowing T)
// CHECK: }
// CHECK: #endif
extension X where T: ~Escapable {
public func g(other: borrowing T) { }
}

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public enum Y<T> : ~Swift.Escapable where T : ~Escapable {
// CHECK: case none
// CHECK: case some(T)
// CHECK: }
// CHECK: #else
// CHECK: public enum Y<T> {
// CHECK: case none
// CHECK: case some(T)
// CHECK: }
public enum Y<T: ~Escapable>: ~Escapable {
case none
case some(T)
}
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public enum Y<T> : ~Swift.Escapable where T : ~Escapable {
// CHECK: case none
// CHECK: case some(T)
// CHECK: }
// CHECK: #else
// CHECK: public enum Y<T> {
// CHECK: case none
// CHECK: case some(T)
// CHECK: }
public enum Y<T: ~Escapable>: ~Escapable {
case none
case some(T)
}

extension Y: Escapable where T: Escapable { }
extension Y: Escapable where T: Escapable { }

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: @lifetime(y)
// CHECK: public func derive<T>(_ y: Test.Y<T>) -> Test.Y<T> where T : ~Escapable
// CHECK: #else
// CHECK: public func derive<T>(_ y: Test.Y<T>) -> Test.Y<T>
// CHECK: #endif
@lifetime(y)
public func derive<T : ~Escapable>(_ y: Y<T>) -> Y<T> {
y
}
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: @lifetime(y)
// CHECK: public func derive<T>(_ y: Test.Y<T>) -> Test.Y<T> where T : ~Escapable
// CHECK: #else
// CHECK: public func derive<T>(_ y: Test.Y<T>) -> Test.Y<T>
// CHECK: #endif
@lifetime(y)
public func derive<T : ~Escapable>(_ y: Y<T>) -> Y<T> {
y
}

// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public func derive<T>(_ x: Test.X<T>) -> dependsOn(x) Test.X<T> where T : ~Escapable
// CHECK: #else
// CHECK: public func derive<T>(_ x: Test.X<T>) -> Test.X<T>
// CHECK: #endif
public func derive<T : ~Escapable>(_ x: X<T>) -> dependsOn(x) X<T> {
x
}
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
// CHECK: public func derive<T>(_ x: Test.X<T>) -> dependsOn(x) Test.X<T> where T : ~Escapable
// CHECK: #else
// CHECK: public func derive<T>(_ x: Test.X<T>) -> Test.X<T>
// CHECK: #endif
public func derive<T : ~Escapable>(_ x: X<T>) -> dependsOn(x) X<T> {
x
}
9 changes: 4 additions & 5 deletions test/SIL/lifetime_dependence_buffer_view_test.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %target-swift-frontend %s -emit-sil \
// RUN: -enable-experimental-feature NonescapableTypes
// RUN: -enable-experimental-feature NonescapableTypes | %FileCheck %s

// REQUIRES: asserts
// REQUIRES: swift_in_compiler
Expand Down Expand Up @@ -57,8 +57,7 @@ public struct BufferView<Element> : ~Escapable {
let start: BufferViewIndex<Element>
public let count: Int
private var baseAddress: UnsafeRawPointer { start._rawValue }
// TODO: Enable diagnostics once this initializer's store to temporary is handled
// CHECK: sil @$s31lifetime_dependence_scope_fixup10BufferViewV11baseAddress5count9dependsOnACyxGSVYls_Siqd__htclufC : $@convention(method) <Element><Owner> (UnsafeRawPointer, Int, @in_guaranteed Owner, @thin BufferView<Element>.Type) -> _scope(1) @owned BufferView<Element> {
// CHECK: sil @$s36lifetime_dependence_buffer_view_test10BufferViewV11baseAddress5count9dependsOnACyxGSV_Siqd__htcRi_d__Ri0_d__lufC : $@convention(method) <Element><Owner where Owner : ~Copyable, Owner : ~Escapable> (UnsafeRawPointer, Int, @in_guaranteed Owner, @thin BufferView<Element>.Type) -> _inherit(2) @owned BufferView<Element> {
public init<Owner: ~Copyable & ~Escapable>(
baseAddress: UnsafeRawPointer,
count: Int,
Expand All @@ -68,7 +67,7 @@ public struct BufferView<Element> : ~Escapable {
start: .init(rawValue: baseAddress), count: count, dependsOn: owner
)
}
// CHECK: sil hidden @$s31lifetime_dependence_scope_fixup10BufferViewV5start5count9dependsOnACyxGAA0eF5IndexVyxGYls_Siqd__htclufC : $@convention(method) <Element><Owner> (BufferViewIndex<Element>, Int, @in_guaranteed Owner, @thin BufferView<Element>.Type) -> _scope(1) @owned BufferView<Element> {
// CHECK: sil hidden @$s36lifetime_dependence_buffer_view_test10BufferViewV5start5count9dependsOnACyxGAA0fG5IndexVyxG_Siqd__htcRi_d__Ri0_d__lufC : $@convention(method) <Element><Owner where Owner : ~Copyable, Owner : ~Escapable> (BufferViewIndex<Element>, Int, @in_guaranteed Owner, @thin BufferView<Element>.Type) -> _inherit(2) @owned BufferView<Element> {
init<Owner: ~Copyable & ~Escapable>(
start index: BufferViewIndex<Element>,
count: Int,
Expand Down Expand Up @@ -122,7 +121,7 @@ extension BufferView {
}
}

// CHECK: sil @$s31lifetime_dependence_scope_fixup10BufferViewVyACyxGAA9FakeRangeVyAA0eF5IndexVyxGGcig : $@convention(method) <Element> (FakeRange<BufferViewIndex<Element>>, @guaranteed BufferView<Element>) -> _scope(0) @owned BufferView<Element> {
// CHECK: sil @$s36lifetime_dependence_buffer_view_test10BufferViewVyACyxGAA9FakeRangeVyAA0fG5IndexVyxGGcig : $@convention(method) <Element> (FakeRange<BufferViewIndex<Element>>, @guaranteed BufferView<Element>) -> _inherit(1) @owned BufferView<Element> {
public subscript(bounds: FakeRange<BufferViewIndex<Element>>) -> Self {
get {
BufferView(
Expand Down
2 changes: 2 additions & 0 deletions test/SIL/lifetime_dependence_generics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// RUN: -enable-experimental-feature NonescapableTypes \
// RUN: -enable-experimental-feature SuppressedAssociatedTypes | %FileCheck %s

// REQUIRES: asserts
// REQUIRES: swift_in_compiler

protocol P {
associatedtype E: ~Escapable
Expand Down
1 change: 0 additions & 1 deletion test/Sema/explicit_lifetime_dependence_specifiers2.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %target-typecheck-verify-swift -disable-availability-checking -enable-experimental-feature NonescapableTypes
// REQUIRES: asserts
// REQUIRES: nonescapable_types

struct AnotherBufferView : ~Escapable, BitwiseCopyable {
let ptr: UnsafeRawBufferPointer
Expand Down
2 changes: 0 additions & 2 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ if "@SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY@" == "TRUE":
config.available_features.add('concurrency')
if "@SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED@" == "TRUE":
config.available_features.add('distributed')
if "@SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES@" == "TRUE":
config.available_features.add('nonescapable_types')
if "@SWIFT_STDLIB_STATIC_PRINT@" == "TRUE":
config.available_features.add('stdlib_static_print')
if "@SWIFT_STDLIB_ENABLE_UNICODE_DATA" == "TRUE":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def __init__(self, args, toolchain, source_dir, build_dir):
# Add experimental distributed flag.
self.cmake_options.extend(self._enable_experimental_distributed)

# Add experimental NonescapableTypes flag.
self.cmake_options.extend(self._enable_experimental_nonescapable_types)

# Add backtracing flag.
self.cmake_options.extend(self._enable_backtracing)

Expand Down Expand Up @@ -208,11 +205,6 @@ def _enable_experimental_distributed(self):
return [('SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL',
self.args.enable_experimental_distributed)]

@property
def _enable_experimental_nonescapable_types(self):
return [('SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL',
self.args.enable_experimental_nonescapable_types)]

@property
def _enable_backtracing(self):
return [('SWIFT_ENABLE_BACKTRACING:BOOL',
Expand Down
15 changes: 0 additions & 15 deletions utils/swift_build_support/tests/products/test_swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def test_by_default_no_cmake_options(self):
'-DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP:BOOL=FALSE',
'-DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION:BOOL=FALSE',
'-DSWIFT_ENABLE_BACKTRACING:BOOL=FALSE',
Expand Down Expand Up @@ -143,7 +142,6 @@ def test_swift_runtime_tsan(self):
'-DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP:BOOL=FALSE',
'-DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION:BOOL=FALSE',
'-DSWIFT_ENABLE_BACKTRACING:BOOL=FALSE',
Expand Down Expand Up @@ -421,19 +419,6 @@ def test_experimental_distributed_flags(self):
[x for x in swift.cmake_options
if 'DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED' in x])

def test_experimental_nonescapable_types_flags(self):
self.args.enable_experimental_nonescapable_types = True
swift = Swift(
args=self.args,
toolchain=self.toolchain,
source_dir='/path/to/src',
build_dir='/path/to/build')
self.assertEqual(
['-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL='
'TRUE'],
[x for x in swift.cmake_options
if 'DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES' in x])

def test_experimental_observation_flags(self):
self.args.enable_experimental_observation = True
swift = Swift(
Expand Down
2 changes: 0 additions & 2 deletions validation-test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ if "@SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY@" == "TRUE":
config.available_features.add('concurrency')
if "@SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED@" == "TRUE":
config.available_features.add('distributed')
if "@SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES@" == "TRUE":
config.available_features.add('nonescapable_types')
if "@SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING@" == "TRUE":
config.available_features.add('string_processing')
if "@SWIFT_STDLIB_ENABLE_DEBUG_PRECONDITIONS_IN_RELEASE@" == "TRUE":
Expand Down