|
8 | 8 | // REQUIRES: swift_in_compiler |
9 | 9 | // REQUIRES: swift_feature_LifetimeDependence |
10 | 10 |
|
11 | | -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return |
12 | | -/// a value identical to `dependent` with a lifetime dependency on the caller's |
13 | | -/// borrow scope of the `source` argument. |
14 | | -@_unsafeNonescapableResult |
15 | | -@_transparent |
16 | | -@lifetime(borrow source) |
17 | | -internal func _overrideLifetime< |
18 | | - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable |
19 | | ->( |
20 | | - _ dependent: consuming T, borrowing source: borrowing U |
21 | | -) -> T { |
22 | | - dependent |
23 | | -} |
24 | | - |
25 | | -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return |
26 | | -/// a value identical to `dependent` that inherits all lifetime dependencies from |
27 | | -/// the `source` argument. |
28 | | -@_unsafeNonescapableResult |
29 | | -@_transparent |
30 | | -@lifetime(copy source) |
31 | | -internal func _overrideLifetime< |
32 | | - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable |
33 | | ->( |
34 | | - _ dependent: consuming T, copying source: borrowing U |
35 | | -) -> T { |
36 | | - dependent |
37 | | -} |
38 | | - |
39 | | -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return |
40 | | -/// a value identical to `dependent` that inherits all lifetime dependencies from |
41 | | -/// the `source` argument. |
42 | | -@_unsafeNonescapableResult |
43 | | -@_transparent |
44 | | -@lifetime(&source) |
45 | | -internal func _overrideLifetime< |
46 | | - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable |
47 | | ->( |
48 | | - _ dependent: consuming T, mutating source: inout U |
49 | | -) -> T { |
50 | | - dependent |
51 | | -} |
52 | | - |
53 | 11 | struct MutableSpan : ~Escapable, ~Copyable { |
54 | 12 | let base: UnsafeMutableRawPointer |
55 | 13 | let count: Int |
|
0 commit comments