21
21
/// let toAdd = 100
22
22
/// let b = a + CollectionOfOne(toAdd)
23
23
/// // b == [1, 2, 3, 4, 100]
24
- @_fixed_layout // FIXME(sil-serialize-all)
24
+ @_fixed_layout // trivial-implementation
25
25
public struct CollectionOfOne < Element> {
26
- @usableFromInline // FIXME(sil-serialize-all)
26
+ @usableFromInline // trivial-implementation
27
27
internal var _element : Element
28
28
29
29
/// Creates an instance containing just the given element.
30
30
///
31
31
/// - Parameter element: The element to store in the collection.
32
- @inlinable // FIXME(sil-serialize-all)
32
+ @inlinable // trivial-implementation
33
33
public init ( _ element: Element ) {
34
34
self . _element = element
35
35
}
@@ -39,14 +39,14 @@ extension CollectionOfOne {
39
39
/// An iterator that produces one or zero instances of an element.
40
40
///
41
41
/// `IteratorOverOne` is the iterator for the `CollectionOfOne` type.
42
- @_fixed_layout // FIXME(sil-serialize-all)
42
+ @_fixed_layout // trivial-implementation
43
43
public struct Iterator {
44
- @usableFromInline // FIXME(sil-serialize-all)
44
+ @usableFromInline // trivial-implementation
45
45
internal var _elements : Element ?
46
46
47
47
/// Construct an instance that generates `_element!`, or an empty
48
48
/// sequence if `_element == nil`.
49
- @inlinable // FIXME(sil-serialize-all)
49
+ @inlinable // trivial-implementation
50
50
public // @testable
51
51
init ( _elements: Element ? ) {
52
52
self . _elements = _elements
@@ -62,7 +62,7 @@ extension CollectionOfOne.Iterator: IteratorProtocol {
62
62
///
63
63
/// - Returns: The next element in the underlying sequence, if a next element
64
64
/// exists; otherwise, `nil`.
65
- @inlinable // FIXME(sil-serialize-all)
65
+ @inlinable // trivial-implementation
66
66
public mutating func next( ) -> Element ? {
67
67
let result = _elements
68
68
_elements = nil
@@ -88,7 +88,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
88
88
/// last valid subscript argument.
89
89
///
90
90
/// In a `CollectionOfOne` instance, `endIndex` is always `1`.
91
- @inlinable // FIXME(sil-serialize-all)
91
+ @inlinable // trivial-implementation
92
92
public var endIndex : Index {
93
93
return 1
94
94
}
@@ -97,7 +97,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
97
97
///
98
98
/// - Parameter i: A valid index of the collection. `i` must be `0`.
99
99
/// - Returns: The index value immediately after `i`.
100
- @inlinable // FIXME(sil-serialize-all)
100
+ @inlinable // trivial-implementation
101
101
public func index( after i: Index ) -> Index {
102
102
_precondition ( i == startIndex)
103
103
return 1
@@ -107,7 +107,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
107
107
///
108
108
/// - Parameter i: A valid index of the collection. `i` must be `1`.
109
109
/// - Returns: The index value immediately before `i`.
110
- @inlinable // FIXME(sil-serialize-all)
110
+ @inlinable // trivial-implementation
111
111
public func index( before i: Index ) -> Index {
112
112
_precondition ( i == endIndex)
113
113
return 0
@@ -116,7 +116,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
116
116
/// Returns an iterator over the elements of this collection.
117
117
///
118
118
/// - Complexity: O(1)
119
- @inlinable // FIXME(sil-serialize-all)
119
+ @inlinable // trivial-implementation
120
120
public func makeIterator( ) -> Iterator {
121
121
return Iterator ( _elements: _element)
122
122
}
@@ -125,7 +125,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
125
125
///
126
126
/// - Parameter position: The position of the element to access. The only
127
127
/// valid position in a `CollectionOfOne` instance is `0`.
128
- @inlinable // FIXME(sil-serialize-all)
128
+ @inlinable // trivial-implementation
129
129
public subscript( position: Int ) -> Element {
130
130
get {
131
131
_precondition ( position == 0 , " Index out of range " )
@@ -137,7 +137,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
137
137
}
138
138
}
139
139
140
- @inlinable // FIXME(sil-serialize-all)
140
+ @inlinable // trivial-implementation
141
141
public subscript( bounds: Range < Int > ) -> SubSequence {
142
142
get {
143
143
_failEarlyRangeCheck ( bounds, bounds: 0 ..< 1 )
@@ -152,7 +152,7 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
152
152
}
153
153
154
154
/// The number of elements in the collection, which is always one.
155
- @inlinable // FIXME(sil-serialize-all)
155
+ @inlinable // trivial-implementation
156
156
public var count : Int {
157
157
return 1
158
158
}
0 commit comments