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 1010//
1111//===----------------------------------------------------------------------===//
1212
13+ #if SPAN_COMPATIBILITY_STUB
14+ import Swift
15+ #endif
16+
1317// A MutableRawSpan represents a span of memory which
1418// contains initialized `Element` instances.
1519@safe
@@ -338,6 +342,10 @@ extension MutableRawSpan {
338342 }
339343}
340344
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+
341349//MARK: copyMemory
342350@available ( SwiftStdlib 6 . 2 , * )
343351extension MutableRawSpan {
@@ -429,6 +437,7 @@ extension MutableRawSpan {
429437 update ( fromContentsOf: source. bytes)
430438 }
431439}
440+ #endif
432441
433442// MARK: sub-spans
434443@available ( SwiftStdlib 6 . 2 , * )
Original file line number Diff line number Diff line change 1010//
1111//===----------------------------------------------------------------------===//
1212
13+ #if SPAN_COMPATIBILITY_STUB
14+ import Swift
15+ #endif
16+
1317// A MutableSpan<Element> represents a span of memory which
1418// contains initialized `Element` instances.
1519@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
44
55 add_swift_target_library("${library_name} " ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
66 FakeStdlib.swift
7+ ../../public /core/Span/MutableRawSpan.swift
8+ ../../public /core/Span/MutableSpan.swift
79 ../../public /core/Span/RawSpan.swift
810 ../../public /core/Span/Span.swift
911
Original file line number Diff line number Diff line change @@ -59,6 +59,20 @@ internal func _overrideLifetime<
5959 dependent
6060}
6161
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+
6276extension Range {
6377 @_alwaysEmitIntoClient
6478 internal init ( _uncheckedBounds bounds: ( lower: Bound , upper: Bound ) ) {
You can’t perform that action at this time.
0 commit comments