File tree Expand file tree Collapse file tree 4 files changed +29
-0
lines changed
toolchain/CompatibilitySpan Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
+ #if SPAN_COMPATIBILITY_STUB
14
+ import Swift
15
+ #endif
16
+
13
17
// A MutableRawSpan represents a span of memory which
14
18
// contains initialized `Element` instances.
15
19
@safe
@@ -338,6 +342,10 @@ extension MutableRawSpan {
338
342
}
339
343
}
340
344
345
+ // FIXME: The functions in this extension crash the SIL optimizer when built inside
346
+ // the stub. But these declarations don't generate a public symbol anyway.
347
+ #if !SPAN_COMPATIBILITY_STUB
348
+
341
349
//MARK: copyMemory
342
350
@available ( SwiftStdlib 6 . 2 , * )
343
351
extension MutableRawSpan {
@@ -429,6 +437,7 @@ extension MutableRawSpan {
429
437
update ( fromContentsOf: source. bytes)
430
438
}
431
439
}
440
+ #endif
432
441
433
442
// MARK: sub-spans
434
443
@available ( SwiftStdlib 6 . 2 , * )
Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
+ #if SPAN_COMPATIBILITY_STUB
14
+ import Swift
15
+ #endif
16
+
13
17
// A MutableSpan<Element> represents a span of memory which
14
18
// contains initialized `Element` instances.
15
19
@safe
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED SWIFT_STDLIB_LIBRARY_BUILD_TY
4
4
5
5
add_swift_target_library ("${library_name} " ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
6
6
FakeStdlib.swift
7
+ ../../public/core/Span/MutableRawSpan.swift
8
+ ../../public/core/Span/MutableSpan.swift
7
9
../../public/core/Span/RawSpan.swift
8
10
../../public/core/Span/Span.swift
9
11
Original file line number Diff line number Diff line change @@ -59,6 +59,20 @@ internal func _overrideLifetime<
59
59
dependent
60
60
}
61
61
62
+ @unsafe
63
+ @_unsafeNonescapableResult
64
+ @_alwaysEmitIntoClient
65
+ @_transparent
66
+ @lifetime ( & source)
67
+ internal func _overrideLifetime<
68
+ T: ~ Copyable & ~ Escapable, U: ~ Copyable & ~ Escapable
69
+ > (
70
+ _ dependent: consuming T ,
71
+ mutating source: inout U
72
+ ) -> T {
73
+ dependent
74
+ }
75
+
62
76
extension Range {
63
77
@_alwaysEmitIntoClient
64
78
internal init ( _uncheckedBounds bounds: ( lower: Bound , upper: Bound ) ) {
You can’t perform that action at this time.
0 commit comments