|
1 | 1 | import Builtin |
2 | 2 |
|
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 | | - |
54 | 3 | // A MutableSpan<Element> represents a span of memory which |
55 | 4 | // contains initialized `Element` instances. |
56 | 5 | @frozen |
|
0 commit comments