Skip to content

Commit 1f66d4c

Browse files
committed
[test] use the stdlib _overrideLifetime functions
1 parent e0cfb31 commit 1f66d4c

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

test/SILOptimizer/Inputs/SpanExtras.swift

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,5 @@
11
import Builtin
22

3-
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
4-
/// a value identical to `dependent` with a lifetime dependency on the caller's
5-
/// borrow scope of the `source` argument.
6-
@unsafe
7-
@_unsafeNonescapableResult
8-
@_alwaysEmitIntoClient
9-
@_transparent
10-
@lifetime(borrow source)
11-
internal func _overrideLifetime<
12-
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
13-
>(
14-
_ dependent: consuming T, borrowing source: borrowing U
15-
) -> T {
16-
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
17-
// should be expressed by a builtin that is hidden within the function body.
18-
dependent
19-
}
20-
21-
/// Unsafely discard any lifetime dependency on the `dependent` argument. Return
22-
/// a value identical to `dependent` that inherits all lifetime dependencies from
23-
/// the `source` argument.
24-
@unsafe
25-
@_unsafeNonescapableResult
26-
@_alwaysEmitIntoClient
27-
@_transparent
28-
@lifetime(copy source)
29-
internal func _overrideLifetime<
30-
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
31-
>(
32-
_ dependent: consuming T, copying source: borrowing U
33-
) -> T {
34-
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
35-
// should be expressed by a builtin that is hidden within the function body.
36-
dependent
37-
}
38-
39-
@unsafe
40-
@_unsafeNonescapableResult
41-
@_alwaysEmitIntoClient
42-
@_transparent
43-
@lifetime(&source)
44-
internal func _overrideLifetime<
45-
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
46-
>(
47-
_ dependent: consuming T, mutating source: inout U
48-
) -> T {
49-
// TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence
50-
// should be expressed by a builtin that is hidden within the function body.
51-
dependent
52-
}
53-
543
// A MutableSpan<Element> represents a span of memory which
554
// contains initialized `Element` instances.
565
@frozen

0 commit comments

Comments
 (0)