[stdlib] Add consuming/owned annotations to Collection implementations (#19360)

* Add consuming/owned annotations to Collection implementations

* Update SILOptimizer tests

* Fix access_marker_verify test

* XFAIL reconstruct_type_from_mangled_name
This commit is contained in:
Ben Cohen
2018-09-21 12:06:56 -07:00
committed by GitHub
parent 5f461798b5
commit ae6f5dd604
38 changed files with 150 additions and 150 deletions

View File

@@ -30,7 +30,7 @@ internal protocol _ArrayBufferProtocol
/// memory starting at `target`. Return a pointer "past the end" of the
/// just-initialized memory.
@discardableResult
func _copyContents(
__consuming func _copyContents(
subRange bounds: Range<Int>,
initializing target: UnsafeMutablePointer<Element>
) -> UnsafeMutablePointer<Element>
@@ -74,7 +74,7 @@ internal protocol _ArrayBufferProtocol
mutating func replaceSubrange<C>(
_ subrange: Range<Int>,
with newCount: Int,
elementsOf newValues: C
elementsOf newValues: __owned C
) where C : Collection, C.Element == Element
/// Returns a `_SliceBuffer` containing the elements in `bounds`.
@@ -149,7 +149,7 @@ extension _ArrayBufferProtocol where Indices == Range<Int>{
internal mutating func replaceSubrange<C>(
_ subrange: Range<Int>,
with newCount: Int,
elementsOf newValues: C
elementsOf newValues: __owned C
) where C : Collection, C.Element == Element {
_sanityCheck(startIndex == 0, "_SliceBuffer should override this function.")
let oldCount = self.count