Skip to content

Commit 2844583

Browse files
authored
Merge pull request swiftlang#12229 from moiseev/resilience-fix
2 parents 49b7b75 + a24998a commit 2844583

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+126
-1
lines changed

stdlib/public/core/ASCII.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ extension Unicode.ASCII : Unicode.Encoding {
6464
return encode(FromEncoding.decode(content))
6565
}
6666

67+
@_fixed_layout // FIXME(sil-serialize-all)
6768
public struct Parser {
6869
@_inlineable // FIXME(sil-serialize-all)
6970
public init() { }

stdlib/public/core/AnyHashable.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ internal protocol _AnyHashableBox {
5353
func _downCastConditional<T>(into result: UnsafeMutablePointer<T>) -> Bool
5454
}
5555

56+
@_fixed_layout // FIXME(sil-serialize-all)
5657
@_versioned // FIXME(sil-serialize-all)
5758
internal struct _ConcreteHashableBox<Base : Hashable> : _AnyHashableBox {
5859
@_versioned // FIXME(sil-serialize-all)
@@ -141,6 +142,7 @@ internal func _getBridgedCustomAnyHashable<T>(_ value: T) -> AnyHashable? {
141142
/// print(descriptions[AnyHashable(43)]) // prints "nil"
142143
/// print(descriptions[AnyHashable(Int8(43))]!) // prints "an Int8"
143144
/// print(descriptions[AnyHashable(Set(["a", "b"]))]!) // prints "a set of strings"
145+
@_fixed_layout // FIXME(sil-serialize-all)
144146
public struct AnyHashable {
145147
@_versioned // FIXME(sil-serialize-all)
146148
internal var _box: _AnyHashableBox

stdlib/public/core/ArrayCast.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public func _arrayForceCast<SourceElement, TargetElement>(
5252
return source.map { $0 as! TargetElement }
5353
}
5454

55+
@_fixed_layout // FIXME(sil-serialize-all)
5556
@_versioned // FIXME(sil-serialize-all)
5657
internal struct _UnwrappingFailed : Error {
5758
@_inlineable // FIXME(sil-serialize-all)

stdlib/public/core/CharacterUnicodeScalars.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
extension Character {
13+
@_fixed_layout // FIXME(sil-serialize-all)
1314
public struct UnicodeScalarView {
1415
@_versioned // FIXME(sil-serialize-all)
1516
internal let _base: Character
@@ -28,6 +29,7 @@ extension Character {
2829
}
2930

3031
extension Character.UnicodeScalarView {
32+
@_fixed_layout // FIXME(sil-serialize-all)
3133
public struct Iterator {
3234
@_versioned // FIXME(sil-serialize-all)
3335
internal var _base: IndexingIterator<Character.UnicodeScalarView>

stdlib/public/core/Codable.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ public protocol KeyedEncodingContainerProtocol {
418418

419419
/// A concrete container that provides a view into an encoder's storage, making
420420
/// the encoded properties of an encodable type accessible by keys.
421+
@_fixed_layout // FIXME(sil-serialize-all)
421422
public struct KeyedEncodingContainer<K : CodingKey> : KeyedEncodingContainerProtocol {
422423
public typealias Key = K
423424

@@ -1167,6 +1168,7 @@ public protocol KeyedDecodingContainerProtocol {
11671168

11681169
/// A concrete container that provides a view into an decoder's storage, making
11691170
/// the encoded properties of an decodable type accessible by keys.
1171+
@_fixed_layout // FIXME(sil-serialize-all)
11701172
public struct KeyedDecodingContainer<K : CodingKey> : KeyedDecodingContainerProtocol {
11711173
public typealias Key = K
11721174

@@ -2441,6 +2443,7 @@ public protocol SingleValueDecodingContainer {
24412443
//===----------------------------------------------------------------------===//
24422444

24432445
/// A user-defined key for providing context during encoding and decoding.
2446+
@_fixed_layout // FIXME(sil-serialize-all)
24442447
public struct CodingUserInfoKey : RawRepresentable, Equatable, Hashable {
24452448
public typealias RawValue = String
24462449

@@ -2478,6 +2481,7 @@ public struct CodingUserInfoKey : RawRepresentable, Equatable, Hashable {
24782481
/// An error that occurs during the encoding of a value.
24792482
public enum EncodingError : Error {
24802483
/// The context in which the error occurred.
2484+
@_fixed_layout // FIXME(sil-serialize-all)
24812485
public struct Context {
24822486
/// The path of coding keys taken to get to the point of the failing encode call.
24832487
public let codingPath: [CodingKey]
@@ -2551,6 +2555,7 @@ public enum EncodingError : Error {
25512555
/// An error that occurs during the decoding of a value.
25522556
public enum DecodingError : Error {
25532557
/// The context in which the error occurred.
2558+
@_fixed_layout // FIXME(sil-serialize-all)
25542559
public struct Context {
25552560
/// The path of coding keys taken to get to the point of the failing decode call.
25562561
public let codingPath: [CodingKey]

stdlib/public/core/CollectionOfOne.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
/// An iterator that produces one or fewer instances of `Element`.
14+
@_fixed_layout // FIXME(sil-serialize-all)
1415
public struct IteratorOverOne<Element> : IteratorProtocol, Sequence {
1516
/// Construct an instance that generates `_element!`, or an empty
1617
/// sequence if `_element == nil`.
@@ -39,6 +40,7 @@ public struct IteratorOverOne<Element> : IteratorProtocol, Sequence {
3940
}
4041

4142
/// A collection containing a single element of type `Element`.
43+
@_fixed_layout // FIXME(sil-serialize-all)
4244
public struct CollectionOfOne<Element>
4345
: MutableCollection, RandomAccessCollection {
4446

stdlib/public/core/ContiguousArrayBuffer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ internal var _emptyArrayStorage : _EmptyArrayStorage {
7878
}
7979

8080
// The class that implements the storage for a ContiguousArray<Element>
81+
@_fixed_layout // FIXME(sil-serialize-all)
8182
@_versioned
8283
internal final class _ContiguousArrayStorage<
8384
Element

stdlib/public/core/DoubleWidth.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ public struct DoubleWidth<Base : FixedWidthInteger> :
175175
}
176176
}
177177

178+
@_fixed_layout // FIXME(sil-serialize-all)
178179
public struct Words : Collection {
179180
public enum _IndexValue {
180181
case low(Base.Magnitude.Words.Index)
181182
case high(Base.Words.Index)
182183
}
183184

185+
@_fixed_layout // FIXME(sil-serialize-all)
184186
public struct Index : Comparable {
185187
public var _value: _IndexValue
186188

stdlib/public/core/DropWhile.swift.gyb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ from gyb_stdlib_support import (
2525
/// This is the associated iterator for the `LazyDropWhileSequence`,
2626
/// `LazyDropWhileCollection`, and `LazyDropWhileBidirectionalCollection`
2727
/// types.
28+
@_fixed_layout // FIXME(sil-serialize-all)
2829
public struct LazyDropWhileIterator<Base : IteratorProtocol> :
2930
IteratorProtocol, Sequence {
3031

@@ -64,6 +65,7 @@ public struct LazyDropWhileIterator<Base : IteratorProtocol> :
6465

6566
/// A sequence whose elements consist of the elements that follow the initial
6667
/// consecutive elements of some base sequence that satisfy a given predicate.
68+
@_fixed_layout // FIXME(sil-serialize-all)
6769
public struct LazyDropWhileSequence<Base : Sequence> : LazySequenceProtocol {
6870

6971
public typealias Elements = LazyDropWhileSequence
@@ -112,6 +114,7 @@ extension LazySequenceProtocol {
112114

113115
/// A position in a `LazyDropWhileCollection` or
114116
/// `LazyDropWhileBidirectionalCollection` instance.
117+
@_fixed_layout // FIXME(sil-serialize-all)
115118
public struct LazyDropWhileIndex<Base : Collection> : Comparable {
116119
/// The position corresponding to `self` in the underlying collection.
117120
public let base: Base.Index
@@ -151,6 +154,7 @@ public struct LazyDropWhileIndex<Base : Collection> : Comparable {
151154
/// performance given by the `Collection` protocol. Be aware, therefore,
152155
/// that general operations on `${Self}` instances may not have the
153156
/// documented complexity.
157+
@_fixed_layout // FIXME(sil-serialize-all)
154158
public struct ${Self}<
155159
Base : ${Collection}
156160
> : LazyCollectionProtocol, ${Collection} {

stdlib/public/core/EmptyCollection.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
//===----------------------------------------------------------------------===//
1919

2020
/// An iterator that never produces an element.
21+
@_fixed_layout // FIXME(sil-serialize-all)
2122
public struct EmptyIterator<Element> : IteratorProtocol, Sequence {
2223
/// Creates an instance.
2324
@_inlineable // FIXME(sil-serialize-all)
@@ -31,6 +32,7 @@ public struct EmptyIterator<Element> : IteratorProtocol, Sequence {
3132
}
3233

3334
/// A collection whose element type is `Element` but that is always empty.
35+
@_fixed_layout // FIXME(sil-serialize-all)
3436
public struct EmptyCollection<Element> :
3537
RandomAccessCollection, MutableCollection
3638
{

0 commit comments

Comments
 (0)