Skip to content

Commit aecaae3

Browse files
committed
[gardening] adjust Span availability in more tests
1 parent 911fbb6 commit aecaae3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

test/Interop/Cxx/stdlib/use-std-span.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,10 @@ StdSpanTestSuite.test("Span as arg to generic func") {
659659
accessSpanAsSomeGenericParam(sspan)
660660
}
661661

662-
StdSpanTestSuite.test("Convert between Swift and C++ span types") {
663-
guard #available(SwiftStdlib 6.1, *) else {
664-
return
665-
}
662+
StdSpanTestSuite.test("Convert between Swift and C++ span types")
663+
.require(.stdlib_6_2).code {
664+
guard #available(SwiftStdlib 6.2, *) else { return }
665+
666666
do {
667667
var arr: [Int32] = [1, 2, 3]
668668
arr.withUnsafeMutableBufferPointer{ ubpointer in

test/SILOptimizer/lifetime_dependence/stdlib_span.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// =============================================================================
1717

1818
extension UnsafeRawBufferPointer {
19-
@available(SwiftStdlib 6.1, *)
19+
@available(SwiftStdlib 6.2, *)
2020
public var storage: RawSpan {
2121
@lifetime(borrow self)
2222
get {
@@ -26,24 +26,24 @@ extension UnsafeRawBufferPointer {
2626
}
2727
}
2828

29-
@available(SwiftStdlib 6.1, *)
29+
@available(SwiftStdlib 6.2, *)
3030
func read(_ span: RawSpan) {}
3131

32-
@available(SwiftStdlib 6.1, *)
32+
@available(SwiftStdlib 6.2, *)
3333
func testUBPStorage(ubp: UnsafeRawBufferPointer) {
3434
// 'span' is valid within the lexical scope of variable 'ubp', which is the entire function.
3535
let span = ubp.storage
3636
read(span)
3737
}
3838

39-
@available(SwiftStdlib 6.1, *)
39+
@available(SwiftStdlib 6.2, *)
4040
@lifetime(borrow ubp)
4141
func testUBPStorageReturn(ubp: UnsafeRawBufferPointer) -> RawSpan {
4242
// 'storage' can be returned since the function's return value also has a dependence on 'ubp'.
4343
return ubp.storage
4444
}
4545

46-
@available(SwiftStdlib 6.1, *)
46+
@available(SwiftStdlib 6.2, *)
4747
@lifetime(borrow ubp)
4848
func testUBPStorageCopy(ubp: UnsafeRawBufferPointer) -> RawSpan {
4949
let localBuffer = ubp
@@ -52,7 +52,7 @@ func testUBPStorageCopy(ubp: UnsafeRawBufferPointer) -> RawSpan {
5252
// expected-note @-2{{this use causes the lifetime-dependent value to escape}}
5353
}
5454

55-
@available(SwiftStdlib 6.1, *)
55+
@available(SwiftStdlib 6.2, *)
5656
func testUBPStorageEscape(array: [Int64]) {
5757
var span = RawSpan()
5858
array.withUnsafeBytes {

0 commit comments

Comments
 (0)