Skip to content

Commit e9895e8

Browse files
committed
Update stdlib
1 parent eab76df commit e9895e8

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

stdlib/public/core/Array.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ extension Array {
17321732

17331733
@available(SwiftStdlib 6.2, *)
17341734
public var mutableSpan: MutableSpan<Element> {
1735-
@lifetime(/*inout*/borrow self)
1735+
@lifetime(&self)
17361736
@_alwaysEmitIntoClient
17371737
mutating get {
17381738
_makeMutableAndUnique()

stdlib/public/core/ArraySlice.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ extension ArraySlice {
13021302

13031303
@available(SwiftStdlib 6.2, *)
13041304
public var mutableSpan: MutableSpan<Element> {
1305-
@lifetime(/*inout*/borrow self)
1305+
@lifetime(/*inout*/&self)
13061306
@_alwaysEmitIntoClient
13071307
mutating get {
13081308
_makeMutableAndUnique()

stdlib/public/core/ContiguousArray.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ extension ContiguousArray {
12441244

12451245
@available(SwiftStdlib 6.2, *)
12461246
public var mutableSpan: MutableSpan<Element> {
1247-
@lifetime(/*inout*/borrow self)
1247+
@lifetime(&self)
12481248
@_alwaysEmitIntoClient
12491249
mutating get {
12501250
_makeMutableAndUnique()

stdlib/public/core/LifetimeManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ internal func _overrideLifetime<
325325
@_unsafeNonescapableResult
326326
@_alwaysEmitIntoClient
327327
@_transparent
328-
@lifetime(borrow source)
328+
@lifetime(&source)
329329
internal func _overrideLifetime<
330330
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
331331
>(

stdlib/public/core/Span/MutableRawSpan.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ extension MutableRawSpan {
190190

191191
@unsafe
192192
@_alwaysEmitIntoClient
193-
@lifetime(borrow self)
193+
@lifetime(&self)
194194
public mutating func _unsafeMutableView<T: BitwiseCopyable>(
195195
as type: T.Type
196196
) -> MutableSpan<T> {
@@ -448,7 +448,7 @@ extension MutableRawSpan {
448448
///
449449
/// - Complexity: O(1)
450450
@_alwaysEmitIntoClient
451-
@lifetime(borrow self)
451+
@lifetime(&self)
452452
mutating public func extracting(_ bounds: Range<Int>) -> Self {
453453
_precondition(
454454
UInt(bitPattern: bounds.lowerBound) <= UInt(bitPattern: _count) &&
@@ -475,7 +475,7 @@ extension MutableRawSpan {
475475
/// - Complexity: O(1)
476476
@unsafe
477477
@_alwaysEmitIntoClient
478-
@lifetime(borrow self)
478+
@lifetime(&self)
479479
mutating public func extracting(unchecked bounds: Range<Int>) -> Self {
480480
let newStart = unsafe _pointer?.advanced(by: bounds.lowerBound)
481481
let newSpan = unsafe Self(_unchecked: newStart, byteCount: bounds.count)
@@ -496,7 +496,7 @@ extension MutableRawSpan {
496496
///
497497
/// - Complexity: O(1)
498498
@_alwaysEmitIntoClient
499-
@lifetime(borrow self)
499+
@lifetime(&self)
500500
mutating public func extracting(
501501
_ bounds: some RangeExpression<Int>
502502
) -> Self {
@@ -520,7 +520,7 @@ extension MutableRawSpan {
520520
/// - Complexity: O(1)
521521
@unsafe
522522
@_alwaysEmitIntoClient
523-
@lifetime(borrow self)
523+
@lifetime(&self)
524524
mutating public func extracting(unchecked bounds: ClosedRange<Int>) -> Self {
525525
let range = unsafe Range(
526526
_uncheckedBounds: (bounds.lowerBound, bounds.upperBound+1)
@@ -538,7 +538,7 @@ extension MutableRawSpan {
538538
///
539539
/// - Complexity: O(1)
540540
@_alwaysEmitIntoClient
541-
@lifetime(borrow self)
541+
@lifetime(&self)
542542
mutating public func extracting(_: UnboundedRange) -> Self {
543543
let newSpan = unsafe Self(_unchecked: _start(), byteCount: _count)
544544
return unsafe _overrideLifetime(newSpan, mutating: &self)
@@ -565,7 +565,7 @@ extension MutableRawSpan {
565565
///
566566
/// - Complexity: O(1)
567567
@_alwaysEmitIntoClient
568-
@lifetime(borrow self)
568+
@lifetime(&self)
569569
mutating public func extracting(first maxLength: Int) -> Self {
570570
_precondition(maxLength >= 0, "Can't have a prefix of negative length")
571571
let newCount = min(maxLength, byteCount)
@@ -588,7 +588,7 @@ extension MutableRawSpan {
588588
///
589589
/// - Complexity: O(1)
590590
@_alwaysEmitIntoClient
591-
@lifetime(borrow self)
591+
@lifetime(&self)
592592
mutating public func extracting(droppingLast k: Int) -> Self {
593593
_precondition(k >= 0, "Can't drop a negative number of elements")
594594
let droppedCount = min(k, byteCount)
@@ -613,7 +613,7 @@ extension MutableRawSpan {
613613
///
614614
/// - Complexity: O(1)
615615
@_alwaysEmitIntoClient
616-
@lifetime(borrow self)
616+
@lifetime(&self)
617617
mutating public func extracting(last maxLength: Int) -> Self {
618618
_precondition(maxLength >= 0, "Can't have a suffix of negative length")
619619
let newCount = min(maxLength, byteCount)
@@ -637,7 +637,7 @@ extension MutableRawSpan {
637637
///
638638
/// - Complexity: O(1)
639639
@_alwaysEmitIntoClient
640-
@lifetime(borrow self)
640+
@lifetime(&self)
641641
mutating public func extracting(droppingFirst k: Int) -> Self {
642642
_precondition(k >= 0, "Can't drop a negative number of bytes")
643643
let droppedCount = min(k, byteCount)

stdlib/public/core/Span/MutableSpan.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ extension MutableSpan where Element: ~Copyable {
666666
///
667667
/// - Complexity: O(1)
668668
@_alwaysEmitIntoClient
669-
@lifetime(borrow self)
669+
@lifetime(&self)
670670
mutating public func extracting(_ bounds: Range<Index>) -> Self {
671671
_precondition(
672672
UInt(bitPattern: bounds.lowerBound) <= UInt(bitPattern: _count) &&
@@ -693,7 +693,7 @@ extension MutableSpan where Element: ~Copyable {
693693
/// - Complexity: O(1)
694694
@unsafe
695695
@_alwaysEmitIntoClient
696-
@lifetime(borrow self)
696+
@lifetime(&self)
697697
mutating public func extracting(unchecked bounds: Range<Index>) -> Self {
698698
let delta = bounds.lowerBound &* MemoryLayout<Element>.stride
699699
let newStart = unsafe _pointer?.advanced(by: delta)
@@ -715,7 +715,7 @@ extension MutableSpan where Element: ~Copyable {
715715
///
716716
/// - Complexity: O(1)
717717
@_alwaysEmitIntoClient
718-
@lifetime(borrow self)
718+
@lifetime(&self)
719719
mutating public func extracting(
720720
_ bounds: some RangeExpression<Index>
721721
) -> Self {
@@ -739,7 +739,7 @@ extension MutableSpan where Element: ~Copyable {
739739
/// - Complexity: O(1)
740740
@unsafe
741741
@_alwaysEmitIntoClient
742-
@lifetime(borrow self)
742+
@lifetime(&self)
743743
mutating public func extracting(
744744
unchecked bounds: ClosedRange<Index>
745745
) -> Self {
@@ -759,7 +759,7 @@ extension MutableSpan where Element: ~Copyable {
759759
///
760760
/// - Complexity: O(1)
761761
@_alwaysEmitIntoClient
762-
@lifetime(borrow self)
762+
@lifetime(&self)
763763
mutating public func extracting(_: UnboundedRange) -> Self {
764764
let newSpan = unsafe Self(_unchecked: _start(), count: _count)
765765
return unsafe _overrideLifetime(newSpan, mutating: &self)
@@ -786,7 +786,7 @@ extension MutableSpan where Element: ~Copyable {
786786
///
787787
/// - Complexity: O(1)
788788
@_alwaysEmitIntoClient
789-
@lifetime(borrow self)
789+
@lifetime(&self)
790790
mutating public func extracting(first maxLength: Int) -> Self {
791791
_precondition(maxLength >= 0, "Can't have a prefix of negative length")
792792
let newCount = min(maxLength, count)
@@ -809,7 +809,7 @@ extension MutableSpan where Element: ~Copyable {
809809
///
810810
/// - Complexity: O(1)
811811
@_alwaysEmitIntoClient
812-
@lifetime(borrow self)
812+
@lifetime(&self)
813813
mutating public func extracting(droppingLast k: Int) -> Self {
814814
_precondition(k >= 0, "Can't drop a negative number of elements")
815815
let droppedCount = min(k, count)
@@ -834,7 +834,7 @@ extension MutableSpan where Element: ~Copyable {
834834
///
835835
/// - Complexity: O(1)
836836
@_alwaysEmitIntoClient
837-
@lifetime(borrow self)
837+
@lifetime(&self)
838838
mutating public func extracting(last maxLength: Int) -> Self {
839839
_precondition(maxLength >= 0, "Can't have a suffix of negative length")
840840
let newCount = min(maxLength, count)
@@ -859,7 +859,7 @@ extension MutableSpan where Element: ~Copyable {
859859
///
860860
/// - Complexity: O(1)
861861
@_alwaysEmitIntoClient
862-
@lifetime(borrow self)
862+
@lifetime(&self)
863863
mutating public func extracting(droppingFirst k: Int) -> Self {
864864
_precondition(k >= 0, "Can't drop a negative number of elements")
865865
let droppedCount = min(k, count)

0 commit comments

Comments
 (0)