@@ -258,6 +258,7 @@ extension MutableSpan where Element: ~Copyable {
258
258
_precondition ( indices. contains ( position) , " index out of bounds " )
259
259
return unsafe UnsafePointer( _unsafeAddressOfElement ( unchecked: position) )
260
260
}
261
+ @lifetime ( self : copy self )
261
262
unsafeMutableAddress {
262
263
_precondition ( indices. contains ( position) , " index out of bounds " )
263
264
return unsafe _unsafeAddressOfElement( unchecked: position)
@@ -278,6 +279,7 @@ extension MutableSpan where Element: ~Copyable {
278
279
unsafeAddress {
279
280
unsafe UnsafePointer( _unsafeAddressOfElement ( unchecked: position) )
280
281
}
282
+ @lifetime ( self : copy self )
281
283
unsafeMutableAddress {
282
284
unsafe _unsafeAddressOfElement( unchecked: position)
283
285
}
@@ -298,6 +300,7 @@ extension MutableSpan where Element: ~Copyable {
298
300
extension MutableSpan where Element: ~ Copyable {
299
301
300
302
@_alwaysEmitIntoClient
303
+ @lifetime ( self: copy self)
301
304
public mutating func swapAt( _ i: Index , _ j: Index ) {
302
305
_precondition ( indices. contains ( Index ( i) ) )
303
306
_precondition ( indices. contains ( Index ( j) ) )
@@ -306,6 +309,7 @@ extension MutableSpan where Element: ~Copyable {
306
309
307
310
@unsafe
308
311
@_alwaysEmitIntoClient
312
+ @lifetime ( self : copy self )
309
313
public mutating func swapAt( unchecked i: Index , unchecked j: Index ) {
310
314
let pi = unsafe _unsafeAddressOfElement( unchecked: i)
311
315
let pj = unsafe _unsafeAddressOfElement( unchecked: j)
@@ -330,6 +334,7 @@ extension MutableSpan where Element: BitwiseCopyable {
330
334
_precondition ( indices. contains ( position) , " index out of bounds " )
331
335
return unsafe self[ unchecked: position]
332
336
}
337
+ @lifetime ( self : copy self )
333
338
set {
334
339
_precondition ( indices. contains ( position) , " index out of bounds " )
335
340
unsafe self[ unchecked: position] = newValue
@@ -353,6 +358,7 @@ extension MutableSpan where Element: BitwiseCopyable {
353
358
fromByteOffset: offset, as: Element . self
354
359
)
355
360
}
361
+ @lifetime ( self : copy self )
356
362
set {
357
363
let offset = position&* MemoryLayout< Element> . stride
358
364
unsafe _start( ) . storeBytes (
@@ -375,6 +381,7 @@ extension MutableSpan where Element: ~Copyable {
375
381
376
382
//FIXME: mark closure parameter as non-escaping
377
383
@_alwaysEmitIntoClient
384
+ @lifetime ( self : copy self )
378
385
public mutating func withUnsafeMutableBufferPointer<
379
386
E: Error , Result: ~ Copyable
380
387
> (
@@ -405,6 +412,7 @@ extension MutableSpan where Element: BitwiseCopyable {
405
412
406
413
//FIXME: mark closure parameter as non-escaping
407
414
@_alwaysEmitIntoClient
415
+ @lifetime( self: copy self)
408
416
public mutating func withUnsafeMutableBytes< E: Error, Result: ~ Copyable> (
409
417
_ body: ( _ buffer: UnsafeMutableRawBufferPointer ) throws ( E ) -> Result
410
418
) throws ( E ) -> Result {
@@ -421,13 +429,15 @@ extension MutableSpan where Element: BitwiseCopyable {
421
429
extension MutableSpan {
422
430
423
431
@_alwaysEmitIntoClient
432
+ @lifetime ( self : copy self )
424
433
public mutating func update( repeating repeatedValue: consuming Element ) {
425
434
unsafe _start( ) . withMemoryRebound ( to: Element . self, capacity: count) {
426
435
unsafe $0. update ( repeating: repeatedValue, count: count)
427
436
}
428
437
}
429
438
430
439
@_alwaysEmitIntoClient
440
+ @lifetime ( self : copy self )
431
441
public mutating func update< S: Sequence > (
432
442
from source: S
433
443
) -> ( unwritten: S . Iterator , index: Index ) where S. Element == Element {
@@ -437,6 +447,7 @@ extension MutableSpan {
437
447
}
438
448
439
449
@_alwaysEmitIntoClient
450
+ @lifetime ( self : copy self )
440
451
public mutating func update(
441
452
from elements: inout some IteratorProtocol < Element >
442
453
) -> Index {
@@ -450,6 +461,7 @@ extension MutableSpan {
450
461
}
451
462
452
463
@_alwaysEmitIntoClient
464
+ @lifetime ( self : copy self )
453
465
public mutating func update(
454
466
fromContentsOf source: some Collection < Element >
455
467
) -> Index {
@@ -472,6 +484,7 @@ extension MutableSpan {
472
484
}
473
485
474
486
@_alwaysEmitIntoClient
487
+ @lifetime ( self : copy self )
475
488
public mutating func update( fromContentsOf source: Span < Element > ) -> Index {
476
489
guard !source. isEmpty else { return 0 }
477
490
_precondition (
@@ -489,6 +502,7 @@ extension MutableSpan {
489
502
}
490
503
491
504
@_alwaysEmitIntoClient
505
+ @lifetime ( self : copy self )
492
506
public mutating func update(
493
507
fromContentsOf source: borrowing MutableSpan < Element >
494
508
) -> Index {
@@ -517,6 +531,7 @@ extension MutableSpan where Element: ~Copyable {
517
531
// }
518
532
519
533
@_alwaysEmitIntoClient
534
+ @lifetime ( self : copy self )
520
535
public mutating func moveUpdate(
521
536
fromContentsOf source: UnsafeMutableBufferPointer < Element >
522
537
) -> Index {
@@ -532,6 +547,7 @@ extension MutableSpan where Element: ~Copyable {
532
547
extension MutableSpan {
533
548
534
549
@_alwaysEmitIntoClient
550
+ @lifetime ( self : copy self )
535
551
public mutating func moveUpdate(
536
552
fromContentsOf source: Slice < UnsafeMutableBufferPointer < Element > >
537
553
) -> Index {
@@ -543,6 +559,7 @@ extension MutableSpan {
543
559
extension MutableSpan where Element: BitwiseCopyable {
544
560
545
561
@_alwaysEmitIntoClient
562
+ @lifetime ( self : copy self )
546
563
public mutating func update(
547
564
repeating repeatedValue: Element
548
565
) where Element: BitwiseCopyable {
@@ -556,6 +573,7 @@ extension MutableSpan where Element: BitwiseCopyable {
556
573
}
557
574
558
575
@_alwaysEmitIntoClient
576
+ @lifetime ( self : copy self )
559
577
public mutating func update< S: Sequence > (
560
578
from source: S
561
579
) -> ( unwritten: S . Iterator , index: Index )
@@ -566,6 +584,7 @@ extension MutableSpan where Element: BitwiseCopyable {
566
584
}
567
585
568
586
@_alwaysEmitIntoClient
587
+ @lifetime ( self : copy self )
569
588
public mutating func update(
570
589
from elements: inout some IteratorProtocol < Element >
571
590
) -> Index {
@@ -579,6 +598,7 @@ extension MutableSpan where Element: BitwiseCopyable {
579
598
}
580
599
581
600
@_alwaysEmitIntoClient
601
+ @lifetime ( self : copy self )
582
602
public mutating func update(
583
603
fromContentsOf source: some Collection < Element >
584
604
) -> Index where Element: BitwiseCopyable {
@@ -601,6 +621,7 @@ extension MutableSpan where Element: BitwiseCopyable {
601
621
}
602
622
603
623
@_alwaysEmitIntoClient
624
+ @lifetime ( self : copy self )
604
625
public mutating func update(
605
626
fromContentsOf source: Span < Element >
606
627
) -> Index where Element: BitwiseCopyable {
@@ -619,6 +640,7 @@ extension MutableSpan where Element: BitwiseCopyable {
619
640
}
620
641
621
642
@_alwaysEmitIntoClient
643
+ @lifetime ( self : copy self )
622
644
public mutating func update(
623
645
fromContentsOf source: borrowing MutableSpan < Element >
624
646
) -> Index where Element: BitwiseCopyable {
0 commit comments