Files
swift-mirror/test/SIL/Parser/basic2_noncopyable_generics.sil
2025-06-07 12:49:01 -07:00

37 lines
1.0 KiB
Plaintext

// RUN: %target-sil-opt \
// RUN: %s \
// RUN: -enable-experimental-feature Lifetimes \
// RUN: | \
// RUN: %target-sil-opt \
// RUN: -enable-experimental-feature Lifetimes \
// RUN: | \
// RUN: %FileCheck %s
// REQUIRES: swift_feature_Lifetimes
// For -enable-experimental-feature Lifetimes
// TODO: Once NoncopyableGenerics/NonescapableTypes is no longer behind a feature flag, merge this into basic2.
sil_stage raw
import Swift
// CHECK-LABEL: struct NCG<T> : ~Copyable {
// CHECK-NEXT: var t: T
// CHECK-NEXT: deinit
struct NCG<T> : ~Copyable {
var t: T
deinit
}
// CHECK-LABEL: struct NEG<T> : ~Escapable where T : ~Escapable {
// CHECK-NEXT: var t: T
struct NEG<T : ~Escapable> : ~Escapable {
var t: T
@_lifetime(copy t)
init(_ t: consuming T) {
self.t = t
}
}