Skip to content

Commit f10edf2

Browse files
committed
[C++-only build] Disable fast paths that require SIL optimizer pieces written in Swift
1 parent 94ec24f commit f10edf2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/core/StringBridge.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ extension StringProtocol {
738738

739739
public // SPI(Foundation)
740740
func _toUTF16Indices(_ range: Range<Int>) -> Range<Index> {
741+
#if hasFeature(Macros)
741742
if Self.self == String.self {
742743
let s = unsafeBitCast(self, to: String.self)
743744
return s.utf16._indexRange(for: range, from: s.startIndex)
@@ -746,6 +747,7 @@ extension StringProtocol {
746747
let s = unsafeBitCast(self, to: Substring.self)
747748
return s._slice._base.utf16._indexRange(for: range, from: s.startIndex)
748749
}
750+
#endif
749751
let lowerbound = _toUTF16Index(range.lowerBound)
750752
let upperbound = _toUTF16Index(range.upperBound)
751753
return Range(uncheckedBounds: (lower: lowerbound, upper: upperbound))

0 commit comments

Comments
 (0)