Skip to content

Commit 422ff83

Browse files
committed
Inlineable: trivial implementation
1 parent eeb6721 commit 422ff83

File tree

8 files changed

+46
-46
lines changed

8 files changed

+46
-46
lines changed

stdlib/public/core/ClosedRange.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ extension ClosedRange {
9696
}
9797

9898
extension ClosedRange: RangeExpression {
99-
@inlinable // FIXME(sil-serialize-all)
99+
@inlinable // trivial-implementation
100100
public func relative<C: Collection>(to collection: C) -> Range<Bound>
101101
where C.Index == Bound {
102102
return Range(
@@ -330,7 +330,7 @@ extension Comparable {
330330
/// - Parameters:
331331
/// - minimum: The lower bound for the range.
332332
/// - maximum: The upper bound for the range.
333-
@inlinable // FIXME(sil-serialize-all)
333+
@inlinable // trivial-implementation
334334
@_transparent
335335
public static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self> {
336336
_precondition(
@@ -362,7 +362,7 @@ extension Strideable where Stride: SignedInteger {
362362
/// - Parameters:)`.
363363
/// - minimum: The lower bound for the range.
364364
/// - maximum: The upper bound for the range.
365-
@inlinable // FIXME(sil-serialize-all)
365+
@inlinable // trivial-implementation
366366
@_transparent
367367
public static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self> {
368368
// FIXME: swift-3-indexing-model: tests for traps.
@@ -404,7 +404,7 @@ extension ClosedRange: Hashable where Bound: Hashable {
404404

405405
extension ClosedRange : CustomStringConvertible {
406406
/// A textual representation of the range.
407-
@inlinable // FIXME(sil-serialize-all)...
407+
@inlinable // trivial-implementation...
408408
public var description: String {
409409
return "\(lowerBound)...\(upperBound)"
410410
}
@@ -444,7 +444,7 @@ extension ClosedRange {
444444
///
445445
/// - Parameter limits: The range to clamp the bounds of this range.
446446
/// - Returns: A new range clamped to the bounds of `limits`.
447-
@inlinable // FIXME(sil-serialize-all)
447+
@inlinable // trivial-implementation
448448
@inline(__always)
449449
public func clamped(to limits: ClosedRange) -> ClosedRange {
450450
let lower =

stdlib/public/core/Collection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ extension Collection {
10941094
/// `IndexingIterator<Self>`.
10951095
extension Collection where Iterator == IndexingIterator<Self> {
10961096
/// Returns an iterator over the elements of the collection.
1097-
@inlinable // FIXME(sil-serialize-all)
1097+
@inlinable // trivial-implementation
10981098
@inline(__always)
10991099
public func makeIterator() -> IndexingIterator<Self> {
11001100
return IndexingIterator(_elements: self)

stdlib/public/core/CollectionOfOne.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
/// let toAdd = 100
2222
/// let b = a + CollectionOfOne(toAdd)
2323
/// // b == [1, 2, 3, 4, 100]
24-
@_fixed_layout // FIXME(sil-serialize-all)
24+
@_fixed_layout // trivial-implementation
2525
public struct CollectionOfOne<Element> {
26-
@usableFromInline // FIXME(sil-serialize-all)
26+
@usableFromInline // trivial-implementation
2727
internal var _element: Element
2828

2929
/// Creates an instance containing just the given element.
3030
///
3131
/// - Parameter element: The element to store in the collection.
32-
@inlinable // FIXME(sil-serialize-all)
32+
@inlinable // trivial-implementation
3333
public init(_ element: Element) {
3434
self._element = element
3535
}
@@ -39,14 +39,14 @@ extension CollectionOfOne {
3939
/// An iterator that produces one or zero instances of an element.
4040
///
4141
/// `IteratorOverOne` is the iterator for the `CollectionOfOne` type.
42-
@_fixed_layout // FIXME(sil-serialize-all)
42+
@_fixed_layout // trivial-implementation
4343
public struct Iterator {
44-
@usableFromInline // FIXME(sil-serialize-all)
44+
@usableFromInline // trivial-implementation
4545
internal var _elements: Element?
4646

4747
/// Construct an instance that generates `_element!`, or an empty
4848
/// sequence if `_element == nil`.
49-
@inlinable // FIXME(sil-serialize-all)
49+
@inlinable // trivial-implementation
5050
public // @testable
5151
init(_elements: Element?) {
5252
self._elements = _elements
@@ -62,7 +62,7 @@ extension CollectionOfOne.Iterator: IteratorProtocol {
6262
///
6363
/// - Returns: The next element in the underlying sequence, if a next element
6464
/// exists; otherwise, `nil`.
65-
@inlinable // FIXME(sil-serialize-all)
65+
@inlinable // trivial-implementation
6666
public mutating func next() -> Element? {
6767
let result = _elements
6868
_elements = nil
@@ -88,7 +88,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
8888
/// last valid subscript argument.
8989
///
9090
/// In a `CollectionOfOne` instance, `endIndex` is always `1`.
91-
@inlinable // FIXME(sil-serialize-all)
91+
@inlinable // trivial-implementation
9292
public var endIndex: Index {
9393
return 1
9494
}
@@ -97,7 +97,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
9797
///
9898
/// - Parameter i: A valid index of the collection. `i` must be `0`.
9999
/// - Returns: The index value immediately after `i`.
100-
@inlinable // FIXME(sil-serialize-all)
100+
@inlinable // trivial-implementation
101101
public func index(after i: Index) -> Index {
102102
_precondition(i == startIndex)
103103
return 1
@@ -107,7 +107,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
107107
///
108108
/// - Parameter i: A valid index of the collection. `i` must be `1`.
109109
/// - Returns: The index value immediately before `i`.
110-
@inlinable // FIXME(sil-serialize-all)
110+
@inlinable // trivial-implementation
111111
public func index(before i: Index) -> Index {
112112
_precondition(i == endIndex)
113113
return 0
@@ -116,7 +116,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
116116
/// Returns an iterator over the elements of this collection.
117117
///
118118
/// - Complexity: O(1)
119-
@inlinable // FIXME(sil-serialize-all)
119+
@inlinable // trivial-implementation
120120
public func makeIterator() -> Iterator {
121121
return Iterator(_elements: _element)
122122
}
@@ -125,7 +125,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
125125
///
126126
/// - Parameter position: The position of the element to access. The only
127127
/// valid position in a `CollectionOfOne` instance is `0`.
128-
@inlinable // FIXME(sil-serialize-all)
128+
@inlinable // trivial-implementation
129129
public subscript(position: Int) -> Element {
130130
get {
131131
_precondition(position == 0, "Index out of range")
@@ -137,7 +137,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
137137
}
138138
}
139139

140-
@inlinable // FIXME(sil-serialize-all)
140+
@inlinable // trivial-implementation
141141
public subscript(bounds: Range<Int>) -> SubSequence {
142142
get {
143143
_failEarlyRangeCheck(bounds, bounds: 0..<1)
@@ -152,7 +152,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
152152
}
153153

154154
/// The number of elements in the collection, which is always one.
155-
@inlinable // FIXME(sil-serialize-all)
155+
@inlinable // trivial-implementation
156156
public var count: Int {
157157
return 1
158158
}

stdlib/public/core/Indices.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ extension Collection where Indices == DefaultIndices<Self> {
119119
/// i = c.index(after: i)
120120
/// }
121121
/// // c == MyFancyCollection([2, 4, 6, 8, 10])
122-
@inlinable // FIXME(sil-serialize-all)
122+
@inlinable // trivial-implementation
123123
public var indices: DefaultIndices<Self> {
124124
return DefaultIndices(
125125
_elements: self,

stdlib/public/core/Range.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ extension Range: RangeExpression {
303303
/// is *not* guaranteed to be inside the bounds of `collection`. Callers
304304
/// should apply the same preconditions to the return value as they would
305305
/// to a range provided directly by the user.
306-
@inlinable // FIXME(sil-serialize-all)
306+
@inlinable // trivial-implementation
307307
public func relative<C: Collection>(to collection: C) -> Range<Bound>
308308
where C.Index == Bound {
309309
return Range(uncheckedBounds: (lower: lowerBound, upper: upperBound))
@@ -329,7 +329,7 @@ extension Range {
329329
///
330330
/// - Parameter limits: The range to clamp the bounds of this range.
331331
/// - Returns: A new range clamped to the bounds of `limits`.
332-
@inlinable // FIXME(sil-serialize-all)
332+
@inlinable // trivial-implementation
333333
@inline(__always)
334334
public func clamped(to limits: Range) -> Range {
335335
let lower =
@@ -346,7 +346,7 @@ extension Range {
346346

347347
extension Range : CustomStringConvertible {
348348
/// A textual representation of the range.
349-
@inlinable // FIXME(sil-serialize-all)
349+
@inlinable // trivial-implementation
350350
public var description: String {
351351
return "\(lowerBound)..<\(upperBound)"
352352
}
@@ -430,19 +430,19 @@ extension Range: Hashable where Bound: Hashable {
430430
public struct PartialRangeUpTo<Bound: Comparable> {
431431
public let upperBound: Bound
432432

433-
@inlinable // FIXME(sil-serialize-all)
433+
@inlinable // trivial-implementation
434434
public init(_ upperBound: Bound) { self.upperBound = upperBound }
435435
}
436436

437437
extension PartialRangeUpTo: RangeExpression {
438-
@inlinable // FIXME(sil-serialize-all)
438+
@inlinable // trivial-implementation
439439
@_transparent
440440
public func relative<C: Collection>(to collection: C) -> Range<Bound>
441441
where C.Index == Bound {
442442
return collection.startIndex..<self.upperBound
443443
}
444444

445-
@inlinable // FIXME(sil-serialize-all)
445+
@inlinable // trivial-implementation
446446
@_transparent
447447
public func contains(_ element: Bound) -> Bool {
448448
return element < upperBound
@@ -474,18 +474,18 @@ extension PartialRangeUpTo: RangeExpression {
474474
public struct PartialRangeThrough<Bound: Comparable> {
475475
public let upperBound: Bound
476476

477-
@inlinable // FIXME(sil-serialize-all)
477+
@inlinable // trivial-implementation
478478
public init(_ upperBound: Bound) { self.upperBound = upperBound }
479479
}
480480

481481
extension PartialRangeThrough: RangeExpression {
482-
@inlinable // FIXME(sil-serialize-all)
482+
@inlinable // trivial-implementation
483483
@_transparent
484484
public func relative<C: Collection>(to collection: C) -> Range<Bound>
485485
where C.Index == Bound {
486486
return collection.startIndex..<collection.index(after: self.upperBound)
487487
}
488-
@inlinable // FIXME(sil-serialize-all)
488+
@inlinable // trivial-implementation
489489
@_transparent
490490
public func contains(_ element: Bound) -> Bool {
491491
return element <= upperBound
@@ -577,19 +577,19 @@ extension PartialRangeThrough: RangeExpression {
577577
public struct PartialRangeFrom<Bound: Comparable> {
578578
public let lowerBound: Bound
579579

580-
@inlinable // FIXME(sil-serialize-all)
580+
@inlinable // trivial-implementation
581581
public init(_ lowerBound: Bound) { self.lowerBound = lowerBound }
582582
}
583583

584584
extension PartialRangeFrom: RangeExpression {
585-
@inlinable // FIXME(sil-serialize-all)
585+
@inlinable // trivial-implementation
586586
@_transparent
587587
public func relative<C: Collection>(
588588
to collection: C
589589
) -> Range<Bound> where C.Index == Bound {
590590
return self.lowerBound..<collection.endIndex
591591
}
592-
@inlinable // FIXME(sil-serialize-all)
592+
@inlinable // trivial-implementation
593593
public func contains(_ element: Bound) -> Bool {
594594
return lowerBound <= element
595595
}

stdlib/public/core/Repeat.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension Repeated: RandomAccessCollection {
4545

4646
/// Creates an instance that contains `count` elements having the
4747
/// value `repeatedValue`.
48-
@inlinable
48+
@inlinable // trivial-implementation
4949
internal init(_repeating repeatedValue: Element, count: Int) {
5050
_precondition(count >= 0, "Repetition count should be non-negative")
5151
self.count = count
@@ -56,7 +56,7 @@ extension Repeated: RandomAccessCollection {
5656
///
5757
/// In a `Repeated` collection, `startIndex` is always equal to zero. If the
5858
/// collection is empty, `startIndex` is equal to `endIndex`.
59-
@inlinable
59+
@inlinable // trivial-implementation
6060
public var startIndex: Index {
6161
return 0
6262
}
@@ -66,7 +66,7 @@ extension Repeated: RandomAccessCollection {
6666
///
6767
/// In a `Repeated` collection, `endIndex` is always equal to `count`. If the
6868
/// collection is empty, `endIndex` is equal to `startIndex`.
69-
@inlinable
69+
@inlinable // trivial-implementation
7070
public var endIndex: Index {
7171
return count
7272
}
@@ -76,7 +76,7 @@ extension Repeated: RandomAccessCollection {
7676
/// - Parameter position: The position of the element to access. `position`
7777
/// must be a valid index of the collection that is not equal to the
7878
/// `endIndex` property.
79-
@inlinable
79+
@inlinable // trivial-implementation
8080
public subscript(position: Int) -> Element {
8181
_precondition(position >= 0 && position < count, "Index out of range")
8282
return repeatedValue
@@ -103,7 +103,7 @@ extension Repeated: RandomAccessCollection {
103103
/// - count: The number of times to repeat `element`.
104104
/// - Returns: A collection that contains `count` elements that are all
105105
/// `element`.
106-
@inlinable
106+
@inlinable // trivial-implementation
107107
public func repeatElement<T>(_ element: T, count n: Int) -> Repeated<T> {
108108
return Repeated(_repeating: element, count: n)
109109
}

stdlib/public/core/StringIndexConversions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extension String.Index {
7979
/// If this index does not have an exact corresponding position in `utf8`,
8080
/// this method returns `nil`. For example, an attempt to convert the
8181
/// position of a UTF-16 trailing surrogate returns `nil`.
82-
@inlinable // FIXME(sil-serialize-all)
82+
@inlinable // trivial-implementation
8383
public func samePosition(
8484
in utf8: String.UTF8View
8585
) -> String.UTF8View.Index? {
@@ -108,7 +108,7 @@ extension String.Index {
108108
/// index. If this index does not have an exact corresponding position in
109109
/// `utf16`, this method returns `nil`. For example, an attempt to convert
110110
/// the position of a UTF-8 continuation byte returns `nil`.
111-
@inlinable // FIXME(sil-serialize-all)
111+
@inlinable // trivial-implementation
112112
public func samePosition(
113113
in utf16: String.UTF16View
114114
) -> String.UTF16View.Index? {

stdlib/public/core/Tuple.swift.gyb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ comparableOperators = [
3131
/// - Parameters:
3232
/// - lhs: An empty tuple.
3333
/// - rhs: An empty tuple.
34-
@inlinable // FIXME(sil-serialize-all)
34+
@inlinable // trivial-implementation
3535
public func ==(lhs: (), rhs: ()) -> Bool {
3636
return true
3737
}
@@ -44,7 +44,7 @@ public func ==(lhs: (), rhs: ()) -> Bool {
4444
/// - Parameters:
4545
/// - lhs: An empty tuple.
4646
/// - rhs: An empty tuple.
47-
@inlinable // FIXME(sil-serialize-all)
47+
@inlinable // trivial-implementation
4848
public func !=(lhs: (), rhs: ()) -> Bool {
4949
return false
5050
}
@@ -58,7 +58,7 @@ public func !=(lhs: (), rhs: ()) -> Bool {
5858
/// - Parameters:
5959
/// - lhs: An empty tuple.
6060
/// - rhs: An empty tuple.
61-
@inlinable // FIXME(sil-serialize-all)
61+
@inlinable // trivial-implementation
6262
public func <(lhs: (), rhs: ()) -> Bool {
6363
return false
6464
}
@@ -72,7 +72,7 @@ public func <(lhs: (), rhs: ()) -> Bool {
7272
/// - Parameters:
7373
/// - lhs: An empty tuple.
7474
/// - rhs: An empty tuple.
75-
@inlinable // FIXME(sil-serialize-all)
75+
@inlinable // trivial-implementation
7676
public func <=(lhs: (), rhs: ()) -> Bool {
7777
return true
7878
}
@@ -86,7 +86,7 @@ public func <=(lhs: (), rhs: ()) -> Bool {
8686
/// - Parameters:
8787
/// - lhs: An empty tuple.
8888
/// - rhs: An empty tuple.
89-
@inlinable // FIXME(sil-serialize-all)
89+
@inlinable // trivial-implementation
9090
public func >(lhs: (), rhs: ()) -> Bool {
9191
return false
9292
}
@@ -100,7 +100,7 @@ public func >(lhs: (), rhs: ()) -> Bool {
100100
/// - Parameters:
101101
/// - lhs: An empty tuple.
102102
/// - rhs: An empty tuple.
103-
@inlinable // FIXME(sil-serialize-all)
103+
@inlinable // trivial-implementation
104104
public func >=(lhs: (), rhs: ()) -> Bool {
105105
return true
106106
}

0 commit comments

Comments
 (0)