2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
5
- // Copyright (c) 2024 Apple Inc. and the Swift project authors
5
+ // Copyright (c) 2024 - 2025 Apple Inc. and the Swift project authors
6
6
// Licensed under Apache License v2.0 with Runtime Library Exception
7
7
//
8
8
// See https://swift.org/LICENSE.txt for license information
19
19
/// use-after-free errors. Operations on `Span` are bounds-checked,
20
20
/// ensuring spcial safety and avoiding buffer overflow errors.
21
21
@frozen
22
- @available ( SwiftStdlib 6 . 1 , * )
23
22
@safe
23
+ @available ( SwiftStdlib 6 . 2 , * )
24
24
public struct Span < Element: ~ Copyable & ~ Escapable>
25
25
: ~ Escapable, Copyable, BitwiseCopyable {
26
26
@@ -81,10 +81,10 @@ public struct Span<Element: ~Copyable & ~Escapable>
81
81
}
82
82
}
83
83
84
- @available ( SwiftStdlib 6 . 1 , * )
84
+ @available ( SwiftStdlib 6 . 2 , * )
85
85
extension Span : @unchecked Sendable where Element: Sendable { }
86
86
87
- @available ( SwiftStdlib 6 . 1 , * )
87
+ @available ( SwiftStdlib 6 . 2 , * )
88
88
extension Span where Element: ~ Copyable {
89
89
90
90
/// Unsafely create a `Span` over initialized memory.
@@ -161,7 +161,7 @@ extension Span where Element: ~Copyable {
161
161
}
162
162
}
163
163
164
- @available ( SwiftStdlib 6 . 1 , * )
164
+ @available ( SwiftStdlib 6 . 2 , * )
165
165
extension Span {
166
166
167
167
/// Unsafely create a `Span` over initialized memory.
@@ -207,7 +207,7 @@ extension Span {
207
207
}
208
208
}
209
209
210
- @available ( SwiftStdlib 6 . 1 , * )
210
+ @available ( SwiftStdlib 6 . 2 , * )
211
211
extension Span where Element: BitwiseCopyable {
212
212
213
213
/// Unsafely create a `Span` over initialized memory.
@@ -367,7 +367,7 @@ extension Span where Element: BitwiseCopyable {
367
367
}
368
368
}
369
369
370
- @available ( SwiftStdlib 6 . 1 , * )
370
+ @available ( SwiftStdlib 6 . 2 , * )
371
371
extension Span where Element: ~ Copyable {
372
372
373
373
/// The number of elements in the span.
@@ -399,7 +399,7 @@ extension Span where Element: ~Copyable {
399
399
}
400
400
}
401
401
402
- @available ( SwiftStdlib 6 . 1 , * )
402
+ @available ( SwiftStdlib 6 . 2 , * )
403
403
extension Span where Element: ~ Copyable {
404
404
@_semantics ( " fixed_storage.check_index " )
405
405
@inline ( __always)
@@ -452,7 +452,7 @@ extension Span where Element: ~Copyable {
452
452
}
453
453
}
454
454
455
- @available ( SwiftStdlib 6 . 1 , * )
455
+ @available ( SwiftStdlib 6 . 2 , * )
456
456
extension Span where Element: BitwiseCopyable {
457
457
/// Accesses the element at the specified position in the `Span`.
458
458
///
@@ -489,7 +489,7 @@ extension Span where Element: BitwiseCopyable {
489
489
}
490
490
491
491
// MARK: sub-spans
492
- @available ( SwiftStdlib 6 . 1 , * )
492
+ @available ( SwiftStdlib 6 . 2 , * )
493
493
extension Span where Element: ~ Copyable {
494
494
495
495
/// Constructs a new span over the items within the supplied range of
@@ -603,7 +603,7 @@ extension Span where Element: ~Copyable {
603
603
}
604
604
605
605
// MARK: UnsafeBufferPointer access hatch
606
- @available ( SwiftStdlib 6 . 1 , * )
606
+ @available ( SwiftStdlib 6 . 2 , * )
607
607
extension Span where Element: ~ Copyable {
608
608
609
609
/// Calls a closure with a pointer to the viewed contiguous storage.
@@ -633,7 +633,7 @@ extension Span where Element: ~Copyable {
633
633
}
634
634
}
635
635
636
- @available ( SwiftStdlib 6 . 1 , * )
636
+ @available ( SwiftStdlib 6 . 2 , * )
637
637
extension Span where Element: BitwiseCopyable {
638
638
639
639
/// Calls the given closure with a pointer to the underlying bytes of
@@ -660,7 +660,7 @@ extension Span where Element: BitwiseCopyable {
660
660
}
661
661
}
662
662
663
- @available( SwiftStdlib 6 . 1 , * )
663
+ @available( SwiftStdlib 6 . 2 , * )
664
664
extension Span where Element: ~ Copyable {
665
665
/// Returns a Boolean value indicating whether two `Span` instances
666
666
/// refer to the same region in memory.
@@ -693,7 +693,7 @@ extension Span where Element: ~Copyable {
693
693
}
694
694
695
695
// MARK: prefixes and suffixes
696
- @available ( SwiftStdlib 6 . 1 , * )
696
+ @available ( SwiftStdlib 6 . 2 , * )
697
697
extension Span where Element: ~ Copyable {
698
698
699
699
/// Returns a span containing the initial elements of this span,
0 commit comments