Skip to content

Commit c2abbbf

Browse files
committed
[span] annotate lifetimes that can’t be correct
1 parent 2d65dc4 commit c2abbbf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

stdlib/public/core/Span/RawSpan.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public struct RawSpan: ~Escapable, Copyable, BitwiseCopyable {
2727

2828
@_disallowFeatureSuppression(NonescapableTypes)
2929
@_alwaysEmitIntoClient
30+
//FIXME: should be @lifetime(borrow pointer) rdar://138672380
3031
@lifetime(immortal)
3132
internal init(
3233
_unchecked pointer: borrowing UnsafeRawPointer?,
@@ -56,6 +57,7 @@ extension RawSpan {
5657
/// the newly created `RawSpan`.
5758
@_disallowFeatureSuppression(NonescapableTypes)
5859
@_alwaysEmitIntoClient
60+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
5961
@lifetime(immortal)
6062
public init(
6163
_unsafeBytes buffer: borrowing UnsafeRawBufferPointer
@@ -67,6 +69,7 @@ extension RawSpan {
6769

6870
@_disallowFeatureSuppression(NonescapableTypes)
6971
@_alwaysEmitIntoClient
72+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
7073
@lifetime(immortal)
7174
public init(
7275
_unsafeBytes buffer: borrowing Slice<UnsafeRawBufferPointer>
@@ -85,6 +88,7 @@ extension RawSpan {
8588
/// the newly created `RawSpan`.
8689
@_disallowFeatureSuppression(NonescapableTypes)
8790
@_alwaysEmitIntoClient
91+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
8892
@lifetime(immortal)
8993
public init(
9094
_unsafeBytes buffer: borrowing UnsafeMutableRawBufferPointer
@@ -94,6 +98,7 @@ extension RawSpan {
9498

9599
@_disallowFeatureSuppression(NonescapableTypes)
96100
@_alwaysEmitIntoClient
101+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
97102
@lifetime(immortal)
98103
public init(
99104
_unsafeBytes buffer: borrowing Slice<UnsafeMutableRawBufferPointer>
@@ -114,6 +119,7 @@ extension RawSpan {
114119
/// the newly created `RawSpan`.
115120
@_disallowFeatureSuppression(NonescapableTypes)
116121
@_alwaysEmitIntoClient
122+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
117123
@lifetime(immortal)
118124
public init(
119125
_unsafeStart pointer: borrowing UnsafeRawPointer,
@@ -134,6 +140,7 @@ extension RawSpan {
134140
/// the newly created `RawSpan`.
135141
@_disallowFeatureSuppression(NonescapableTypes)
136142
@_alwaysEmitIntoClient
143+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
137144
@lifetime(immortal)
138145
public init<T: BitwiseCopyable>(
139146
_unsafeElements buffer: borrowing UnsafeBufferPointer<T>
@@ -150,6 +157,7 @@ extension RawSpan {
150157
/// - buffer: a raw buffer to initialized memory.
151158
@_disallowFeatureSuppression(NonescapableTypes)
152159
@_alwaysEmitIntoClient
160+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
153161
@lifetime(immortal)
154162
public init<T: BitwiseCopyable>(
155163
_unsafeElements buffer: borrowing Slice<UnsafeBufferPointer<T>>
@@ -170,6 +178,7 @@ extension RawSpan {
170178
/// the newly created `RawSpan`.
171179
@_disallowFeatureSuppression(NonescapableTypes)
172180
@_alwaysEmitIntoClient
181+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
173182
@lifetime(immortal)
174183
public init<T: BitwiseCopyable>(
175184
_unsafeElements buffer: borrowing UnsafeMutableBufferPointer<T>
@@ -186,6 +195,7 @@ extension RawSpan {
186195
/// - buffer: a raw buffer to initialized memory.
187196
@_disallowFeatureSuppression(NonescapableTypes)
188197
@_alwaysEmitIntoClient
198+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
189199
@lifetime(immortal)
190200
public init<T: BitwiseCopyable>(
191201
_unsafeElements buffer: borrowing Slice<UnsafeMutableBufferPointer<T>>
@@ -208,6 +218,7 @@ extension RawSpan {
208218
/// the newly created `RawSpan`.
209219
@_disallowFeatureSuppression(NonescapableTypes)
210220
@_alwaysEmitIntoClient
221+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
211222
@lifetime(immortal)
212223
public init<T: BitwiseCopyable>(
213224
_unsafeStart pointer: borrowing UnsafePointer<T>,

stdlib/public/core/Span/Span.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public struct Span<Element: ~Copyable & ~Escapable>
2828

2929
@_disallowFeatureSuppression(NonescapableTypes)
3030
@_alwaysEmitIntoClient
31+
//FIXME: should be @lifetime(borrow pointer) rdar://138672380
3132
@lifetime(immortal)
3233
internal init(
3334
_unchecked pointer: borrowing UnsafeRawPointer?,
@@ -57,6 +58,7 @@ extension Span where Element: ~Copyable {
5758
/// the newly created `Span`.
5859
@_disallowFeatureSuppression(NonescapableTypes)
5960
@_alwaysEmitIntoClient
61+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
6062
@lifetime(immortal)
6163
public init(
6264
_unsafeElements buffer: borrowing UnsafeBufferPointer<Element>
@@ -81,6 +83,7 @@ extension Span where Element: ~Copyable {
8183
/// the newly created `Span`.
8284
@_disallowFeatureSuppression(NonescapableTypes)
8385
@_alwaysEmitIntoClient
86+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
8487
@lifetime(immortal)
8588
public init(
8689
_unsafeElements buffer: borrowing UnsafeMutableBufferPointer<Element>
@@ -101,6 +104,7 @@ extension Span where Element: ~Copyable {
101104
/// the newly created `Span`.
102105
@_disallowFeatureSuppression(NonescapableTypes)
103106
@_alwaysEmitIntoClient
107+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
104108
@lifetime(immortal)
105109
public init(
106110
_unsafeStart pointer: borrowing UnsafePointer<Element>,
@@ -126,6 +130,7 @@ extension Span {
126130
/// the newly created `Span`.
127131
@_disallowFeatureSuppression(NonescapableTypes)
128132
@_alwaysEmitIntoClient
133+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
129134
@lifetime(immortal)
130135
public init(
131136
_unsafeElements buffer: borrowing Slice<UnsafeBufferPointer<Element>>
@@ -144,6 +149,7 @@ extension Span {
144149
/// the newly created `Span`.
145150
@_disallowFeatureSuppression(NonescapableTypes)
146151
@_alwaysEmitIntoClient
152+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
147153
@lifetime(immortal)
148154
public init(
149155
_unsafeElements buffer: borrowing Slice<UnsafeMutableBufferPointer<Element>>
@@ -172,6 +178,7 @@ extension Span where Element: BitwiseCopyable {
172178
/// the newly created `Span`.
173179
@_disallowFeatureSuppression(NonescapableTypes)
174180
@_alwaysEmitIntoClient
181+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
175182
@lifetime(immortal)
176183
public init(
177184
_unsafeBytes buffer: borrowing UnsafeRawBufferPointer
@@ -206,6 +213,7 @@ extension Span where Element: BitwiseCopyable {
206213
/// the newly created `Span`.
207214
@_disallowFeatureSuppression(NonescapableTypes)
208215
@_alwaysEmitIntoClient
216+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
209217
@lifetime(immortal)
210218
public init(
211219
_unsafeBytes buffer: borrowing UnsafeMutableRawBufferPointer
@@ -230,6 +238,7 @@ extension Span where Element: BitwiseCopyable {
230238
/// the newly created `Span`.
231239
@_disallowFeatureSuppression(NonescapableTypes)
232240
@_alwaysEmitIntoClient
241+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
233242
@lifetime(immortal)
234243
public init(
235244
_unsafeStart pointer: borrowing UnsafeRawPointer,
@@ -255,6 +264,7 @@ extension Span where Element: BitwiseCopyable {
255264
/// the newly created `Span`.
256265
@_disallowFeatureSuppression(NonescapableTypes)
257266
@_alwaysEmitIntoClient
267+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
258268
@lifetime(immortal)
259269
public init(
260270
_unsafeBytes buffer: borrowing Slice<UnsafeRawBufferPointer>
@@ -278,6 +288,7 @@ extension Span where Element: BitwiseCopyable {
278288
/// the newly created `Span`.
279289
@_disallowFeatureSuppression(NonescapableTypes)
280290
@_alwaysEmitIntoClient
291+
//FIXME: should be @lifetime(borrow <argname>) rdar://138672380
281292
@lifetime(immortal)
282293
public init(
283294
_unsafeBytes buffer: borrowing Slice<UnsafeMutableRawBufferPointer>

0 commit comments

Comments
 (0)