Skip to content

Commit eed9c46

Browse files
committed
[stdlib] mark _uncheckedBounds range inits as unsafe
1 parent c91e295 commit eed9c46

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

stdlib/public/core/ClosedRange.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public struct ClosedRange<Bound: Comparable> {
7070

7171
// This works around _debugPrecondition() impacting the performance of
7272
// optimized code. (rdar://72246338)
73+
@unsafe
7374
@_alwaysEmitIntoClient @inline(__always)
7475
internal init(_uncheckedBounds bounds: (lower: Bound, upper: Bound)) {
7576
self.lowerBound = bounds.lower

stdlib/public/core/Range.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public struct Range<Bound: Comparable> {
159159

160160
// This works around _debugPrecondition() impacting the performance of
161161
// optimized code. (rdar://72246338)
162+
@unsafe
162163
@_alwaysEmitIntoClient @inline(__always)
163164
internal init(_uncheckedBounds bounds: (lower: Bound, upper: Bound)) {
164165
self.lowerBound = bounds.lower

0 commit comments

Comments
 (0)