mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] remove more copies of _overrideLifetime()
This commit is contained in:
@@ -1,21 +1,3 @@
|
||||
@_unsafeNonescapableResult
|
||||
@_alwaysEmitIntoClient
|
||||
@_transparent
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@_alwaysEmitIntoClient
|
||||
@_transparent
|
||||
@lifetime(copy source)
|
||||
internal func _overrideLifetime<T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable>(
|
||||
_ dependent: consuming T, copying source: borrowing U) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
public struct AnotherView : ~Escapable {
|
||||
@usableFromInline let _ptr: UnsafeRawBufferPointer
|
||||
@usableFromInline let _count: Int
|
||||
|
||||
@@ -8,30 +8,6 @@
|
||||
|
||||
import Builtin
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(copy source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, copying source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
struct BufferView : ~Escapable {
|
||||
let ptr: UnsafeRawBufferPointer
|
||||
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSWcfC : $@convention(method) (UnsafeRawBufferPointer, @thin BufferView.Type) -> @lifetime(borrow 0) @owned BufferView {
|
||||
|
||||
@@ -5,30 +5,6 @@
|
||||
|
||||
// REQUIRES: swift_feature_LifetimeDependence
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(copy source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, copying source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
struct BufferView : ~Escapable {
|
||||
let ptr: UnsafeRawBufferPointer
|
||||
let c: Int
|
||||
|
||||
@@ -5,30 +5,6 @@
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: swift_feature_LifetimeDependence
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(copy source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, copying source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
// TODO: Use real Range
|
||||
public struct FakeRange<Bound> {
|
||||
public let lowerBound: Bound
|
||||
|
||||
@@ -6,14 +6,6 @@
|
||||
|
||||
import Builtin
|
||||
|
||||
// Copied from the stdlib until we have Builtin.overrideLifetime.
|
||||
@_unsafeNonescapableResult
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
struct NodeRef: ~Escapable {
|
||||
private var parent: UnsafePointer<Node>
|
||||
|
||||
|
||||
@@ -17,19 +17,6 @@
|
||||
|
||||
import Builtin
|
||||
|
||||
@unsafe
|
||||
@_unsafeNonescapableResult
|
||||
@_alwaysEmitIntoClient
|
||||
@_transparent
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U
|
||||
) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
struct BV : ~Escapable {
|
||||
let p: UnsafeRawPointer
|
||||
let i: Int
|
||||
|
||||
@@ -8,48 +8,6 @@
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: swift_feature_LifetimeDependence
|
||||
|
||||
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
|
||||
/// a value identical to `dependent` with a lifetime dependency on the caller's
|
||||
/// borrow scope of the `source` argument.
|
||||
@_unsafeNonescapableResult
|
||||
@_transparent
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U
|
||||
) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
|
||||
/// a value identical to `dependent` that inherits all lifetime dependencies from
|
||||
/// the `source` argument.
|
||||
@_unsafeNonescapableResult
|
||||
@_transparent
|
||||
@lifetime(copy source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, copying source: borrowing U
|
||||
) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
|
||||
/// a value identical to `dependent` that inherits all lifetime dependencies from
|
||||
/// the `source` argument.
|
||||
@_unsafeNonescapableResult
|
||||
@_transparent
|
||||
@lifetime(&source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, mutating source: inout U
|
||||
) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
struct MutableSpan : ~Escapable, ~Copyable {
|
||||
let base: UnsafeMutableRawPointer
|
||||
let count: Int
|
||||
|
||||
@@ -15,49 +15,6 @@
|
||||
|
||||
import Builtin
|
||||
|
||||
@_unsafeNonescapableResult
|
||||
@_transparent
|
||||
@lifetime(borrow source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, borrowing source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
|
||||
/// a value identical to `dependent` that inherits all lifetime dependencies from
|
||||
/// the `source` argument.
|
||||
@_unsafeNonescapableResult
|
||||
@_transparent
|
||||
@lifetime(copy source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, copying source: borrowing U
|
||||
) -> T {
|
||||
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
|
||||
// should be expressed by a builtin that is hidden within the function body.
|
||||
dependent
|
||||
}
|
||||
|
||||
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
|
||||
/// a value identical to `dependent` that inherits all lifetime dependencies from
|
||||
/// the `source` argument.
|
||||
@_unsafeNonescapableResult
|
||||
@_transparent
|
||||
@lifetime(&source)
|
||||
internal func _overrideLifetime<
|
||||
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
|
||||
>(
|
||||
_ dependent: consuming T, mutating source: inout U
|
||||
) -> T {
|
||||
dependent
|
||||
}
|
||||
|
||||
struct NotEscapable: ~Escapable {}
|
||||
|
||||
// Lifetime dependence semantics by example.
|
||||
|
||||
Reference in New Issue
Block a user