diff --git a/stdlib/public/core/LifetimeManager.swift b/stdlib/public/core/LifetimeManager.swift index eeaeba32b2484..c8c555efb926e 100644 --- a/stdlib/public/core/LifetimeManager.swift +++ b/stdlib/public/core/LifetimeManager.swift @@ -290,7 +290,7 @@ public func _copy(_ value: T) -> T { @_alwaysEmitIntoClient @_transparent @lifetime(borrow source) -internal func _overrideLifetime< +public func _overrideLifetime< T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable >( _ dependent: consuming T, borrowing source: borrowing U @@ -308,7 +308,7 @@ internal func _overrideLifetime< @_alwaysEmitIntoClient @_transparent @lifetime(copy source) -internal func _overrideLifetime< +public func _overrideLifetime< T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable >( _ dependent: consuming T, copying source: borrowing U @@ -326,7 +326,7 @@ internal func _overrideLifetime< @_alwaysEmitIntoClient @_transparent @lifetime(&source) -internal func _overrideLifetime< +public func _overrideLifetime< T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable >( _ dependent: consuming T, diff --git a/test/SILOptimizer/Inputs/SpanExtras.swift b/test/SILOptimizer/Inputs/SpanExtras.swift index 881ac3d998b26..29ddeb2817d39 100644 --- a/test/SILOptimizer/Inputs/SpanExtras.swift +++ b/test/SILOptimizer/Inputs/SpanExtras.swift @@ -1,56 +1,5 @@ import Builtin -/// 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. -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_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. -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_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 -} - -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(&source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, mutating source: inout U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - // A MutableSpan represents a span of memory which // contains initialized `Element` instances. @frozen