diff --git a/stdlib/public/core/CTypes.swift b/stdlib/public/core/CTypes.swift index b3c2038672d76..f7e0592be83fe 100644 --- a/stdlib/public/core/CTypes.swift +++ b/stdlib/public/core/CTypes.swift @@ -202,7 +202,7 @@ extension OpaquePointer { /// Converts a typed `UnsafeMutablePointer` to an opaque C pointer. @_transparent @_preInverseGenerics - public init(@_nonEphemeral _ from: UnsafeMutablePointer) { + public init(@_nonEphemeral _ from: UnsafeMutablePointer) { self._rawValue = from._rawValue } @@ -211,7 +211,7 @@ extension OpaquePointer { /// The result is `nil` if `from` is `nil`. @_transparent @_preInverseGenerics - public init?(@_nonEphemeral _ from: UnsafeMutablePointer?) { + public init?(@_nonEphemeral _ from: UnsafeMutablePointer?) { guard let unwrapped = from else { return nil } self.init(unwrapped) } diff --git a/stdlib/public/core/LifetimeManager.swift b/stdlib/public/core/LifetimeManager.swift index f324622b68d9c..5ff5fea99e088 100644 --- a/stdlib/public/core/LifetimeManager.swift +++ b/stdlib/public/core/LifetimeManager.swift @@ -19,11 +19,20 @@ /// extended. If `body` has a return value, that value is also used as the /// return value for the `withExtendedLifetime(_:_:)` method. /// - Returns: The return value, if any, of the `body` closure parameter. -@inlinable -@_preInverseGenerics +@_alwaysEmitIntoClient public func withExtendedLifetime( _ x: borrowing T, - _ body: () throws -> Result + _ body: () throws -> Result // FIXME: Typed throws rdar://126576356 +) rethrows -> Result { + defer { _fixLifetime(x) } + return try body() +} + +@_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) +@usableFromInline +internal func withExtendedLifetime( + _ x: T, + _ body: () throws -> Result // FIXME: Typed throws rdar://126576356 ) rethrows -> Result { defer { _fixLifetime(x) } return try body() @@ -38,10 +47,18 @@ public func withExtendedLifetime( /// extended. If `body` has a return value, that value is also used as the /// return value for the `withExtendedLifetime(_:_:)` method. /// - Returns: The return value, if any, of the `body` closure parameter. -@inlinable -public func withExtendedLifetime( - // FIXME(NCG): This should have T, Result as ~Copyable, but then the closure would need to take a borrow - _ x: T, _ body: (T) throws -> Result +@_alwaysEmitIntoClient +public func withExtendedLifetime( + _ x: T, _ body: (T) throws -> Result // FIXME: Typed throws rdar://126576356 +) rethrows -> Result { + defer { _fixLifetime(x) } + return try body(x) +} + +@_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) +@usableFromInline +internal func withExtendedLifetime( + _ x: T, _ body: (T) throws -> Result // FIXME: Typed throws rdar://126576356 ) rethrows -> Result { defer { _fixLifetime(x) } return try body(x) diff --git a/stdlib/public/core/ManagedBuffer.swift b/stdlib/public/core/ManagedBuffer.swift index f2a35739aa181..7b1c51e4403ec 100644 --- a/stdlib/public/core/ManagedBuffer.swift +++ b/stdlib/public/core/ManagedBuffer.swift @@ -79,10 +79,8 @@ extension ManagedBuffer where Element: ~Copyable { @inlinable public final class func create( minimumCapacity: Int, - makingHeaderWith factory: ( - ManagedBuffer) throws -> Header + makingHeaderWith factory: (ManagedBuffer) throws -> Header ) rethrows -> ManagedBuffer { - let p = Builtin.allocWithTailElems_1( self, minimumCapacity._builtinWordValue, Element.self) @@ -124,18 +122,20 @@ extension ManagedBuffer where Element: ~Copyable { internal final var headerAddress: UnsafeMutablePointer
{ return UnsafeMutablePointer
(Builtin.addressof(&header)) } +} +extension ManagedBuffer where Element: ~Copyable { /// Call `body` with an `UnsafeMutablePointer` to the stored /// `Header`. /// /// - Note: This pointer is valid only for the duration of the /// call to `body`. - @_preInverseGenerics - @inlinable - public final func withUnsafeMutablePointerToHeader( - _ body: (UnsafeMutablePointer
) throws -> R - ) rethrows -> R { - return try withUnsafeMutablePointers { (v, _) in return try body(v) } + @_alwaysEmitIntoClient + @inline(__always) + public final func withUnsafeMutablePointerToHeader( + _ body: (UnsafeMutablePointer
) throws(E) -> R + ) throws(E) -> R { + try withUnsafeMutablePointers { (v, _) throws(E) in try body(v) } } /// Call `body` with an `UnsafeMutablePointer` to the `Element` @@ -143,12 +143,12 @@ extension ManagedBuffer where Element: ~Copyable { /// /// - Note: This pointer is valid only for the duration of the /// call to `body`. - @_preInverseGenerics - @inlinable - public final func withUnsafeMutablePointerToElements( - _ body: (UnsafeMutablePointer) throws -> R - ) rethrows -> R { - return try withUnsafeMutablePointers { return try body($1) } + @_alwaysEmitIntoClient + @inline(__always) + public final func withUnsafeMutablePointerToElements( + _ body: (UnsafeMutablePointer) throws(E) -> R + ) throws(E) -> R { + try withUnsafeMutablePointers { (_, v) throws(E) in try body(v) } } /// Call `body` with `UnsafeMutablePointer`s to the stored `Header` @@ -156,10 +156,44 @@ extension ManagedBuffer where Element: ~Copyable { /// /// - Note: These pointers are valid only for the duration of the /// call to `body`. - @_preInverseGenerics - @inlinable - public final func withUnsafeMutablePointers( - _ body: (UnsafeMutablePointer
, UnsafeMutablePointer) throws -> R + @_alwaysEmitIntoClient + @inline(__always) + public final func withUnsafeMutablePointers( + _ body: ( + UnsafeMutablePointer
, UnsafeMutablePointer + ) throws(E) -> R + ) throws(E) -> R { + defer { _fixLifetime(self) } + return try body(headerAddress, firstElementAddress) + } +} + +extension ManagedBuffer { + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss13ManagedBufferC25withUnsafeMutablePointersyqd__qd__SpyxG_Spyq_GtKXEKlF") + @usableFromInline + internal final func __legacy_withUnsafeMutablePointerToHeader( + _ body: (UnsafeMutablePointer
) throws -> R + ) rethrows -> R { + return try withUnsafeMutablePointers { (v, _) in return try body(v) } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss13ManagedBufferC32withUnsafeMutablePointerToHeaderyqd__qd__SpyxGKXEKlF") + @usableFromInline + internal final func __legacy_withUnsafeMutablePointerToElements( + _ body: (UnsafeMutablePointer) throws -> R + ) rethrows -> R { + return try withUnsafeMutablePointers { return try body($1) } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss13ManagedBufferC34withUnsafeMutablePointerToElementsyqd__qd__Spyq_GKXEKlF") + @usableFromInline + internal final func __legacy_withUnsafeMutablePointers( + _ body: ( + UnsafeMutablePointer
, UnsafeMutablePointer + ) throws -> R ) rethrows -> R { defer { _fixLifetime(self) } return try body(headerAddress, firstElementAddress) @@ -202,7 +236,10 @@ extension ManagedBuffer where Element: ~Copyable { /// } /// @frozen -public struct ManagedBufferPointer { +public struct ManagedBufferPointer< + Header, + Element: ~Copyable +>: Copyable { @_preInverseGenerics @usableFromInline @@ -244,9 +281,6 @@ public struct ManagedBufferPointer { ManagedBufferPointer(unsafeBufferObject: $0).capacity })) } - // FIXME: workaround for . If we don't - // access header somewhere, its addressor gets linked away - _ = header } /// Manage the given `buffer`. @@ -352,7 +386,9 @@ extension ManagedBufferPointer where Element: ~Copyable { yield &_headerPointer.pointee } } +} +extension ManagedBufferPointer where Element: ~Copyable { /// Returns the object instance being used for storage. @_preInverseGenerics @inlinable @@ -379,12 +415,11 @@ extension ManagedBufferPointer where Element: ~Copyable { /// /// - Note: This pointer is valid only /// for the duration of the call to `body`. - @_preInverseGenerics - @inlinable - public func withUnsafeMutablePointerToHeader( - _ body: (UnsafeMutablePointer
) throws -> R - ) rethrows -> R { - return try withUnsafeMutablePointers { (v, _) in return try body(v) } + @_alwaysEmitIntoClient + public func withUnsafeMutablePointerToHeader( + _ body: (UnsafeMutablePointer
) throws(E) -> R + ) throws(E) -> R { + try withUnsafeMutablePointers { (v, _) throws(E) in try body(v) } } /// Call `body` with an `UnsafeMutablePointer` to the `Element` @@ -392,12 +427,11 @@ extension ManagedBufferPointer where Element: ~Copyable { /// /// - Note: This pointer is valid only for the duration of the /// call to `body`. - @_preInverseGenerics - @inlinable - public func withUnsafeMutablePointerToElements( - _ body: (UnsafeMutablePointer) throws -> R - ) rethrows -> R { - return try withUnsafeMutablePointers { return try body($1) } + @_alwaysEmitIntoClient + public func withUnsafeMutablePointerToElements( + _ body: (UnsafeMutablePointer) throws(E) -> R + ) throws(E) -> R { + try withUnsafeMutablePointers { (_, v) throws(E) in try body(v) } } /// Call `body` with `UnsafeMutablePointer`s to the stored `Header` @@ -405,13 +439,12 @@ extension ManagedBufferPointer where Element: ~Copyable { /// /// - Note: These pointers are valid only for the duration of the /// call to `body`. - @_preInverseGenerics - @inlinable - public func withUnsafeMutablePointers( + @_alwaysEmitIntoClient + public func withUnsafeMutablePointers( _ body: ( UnsafeMutablePointer
, UnsafeMutablePointer - ) throws -> R - ) rethrows -> R { + ) throws(E) -> R + ) throws(E) -> R { defer { _fixLifetime(_nativeBuffer) } return try body(_headerPointer, _elementPointer) } @@ -427,6 +460,38 @@ extension ManagedBufferPointer where Element: ~Copyable { } } +extension ManagedBufferPointer { + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss20ManagedBufferPointerV017withUnsafeMutableC8ToHeaderyqd__qd__SpyxGKXEKlF") + @usableFromInline + internal func withUnsafeMutablePointerToHeader( + _ body: (UnsafeMutablePointer
) throws -> R + ) rethrows -> R { + try withUnsafeMutablePointers { (v, _) in try body(v) } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss20ManagedBufferPointerV017withUnsafeMutableC10ToElementsyqd__qd__Spyq_GKXEKlF") + @usableFromInline + internal func withUnsafeMutablePointerToElements( + _ body: (UnsafeMutablePointer) throws -> R + ) rethrows -> R { + try withUnsafeMutablePointers { (_, v) in try body(v) } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss20ManagedBufferPointerV25withUnsafeMutablePointersyqd__qd__SpyxG_Spyq_GtKXEKlF") + @usableFromInline + internal func withUnsafeMutablePointers( + _ body: ( + UnsafeMutablePointer
, UnsafeMutablePointer + ) throws -> R + ) rethrows -> R { + defer { _fixLifetime(_nativeBuffer) } + return try body(_headerPointer, _elementPointer) + } +} + extension ManagedBufferPointer where Element: ~Copyable { @_preInverseGenerics @inlinable diff --git a/stdlib/public/core/Optional.swift b/stdlib/public/core/Optional.swift index 90a19472bf6e3..361da5c19c823 100644 --- a/stdlib/public/core/Optional.swift +++ b/stdlib/public/core/Optional.swift @@ -185,9 +185,24 @@ extension Optional { /// of the instance. /// - Returns: The result of the given closure. If this instance is `nil`, /// returns `nil`. - @inlinable - public func map( - // FIXME: This needs to support typed throws. + @_alwaysEmitIntoClient + @_disfavoredOverload // FIXME: Workaround for source compat issue with + // functions that used to shadow the original map + // (rdar://125016028) + public func map( + _ transform: (Wrapped) throws(E) -> U + ) throws(E) -> U? { + switch self { + case .some(let y): + return .some(try transform(y)) + case .none: + return .none + } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @usableFromInline + internal func map( _ transform: (Wrapped) throws -> U ) rethrows -> U? { switch self { @@ -220,7 +235,7 @@ extension Optional where Wrapped: ~Copyable { ) throws(E) -> U? { #if $NoncopyableGenerics switch self { - case .some(_borrowing y): + case .some(borrowing y): return .some(try transform(y)) case .none: return .none @@ -251,9 +266,24 @@ extension Optional { /// of the instance. /// - Returns: The result of the given closure. If this instance is `nil`, /// returns `nil`. - @inlinable - public func flatMap( - // FIXME: This needs to support typed throws. + @_alwaysEmitIntoClient + @_disfavoredOverload // FIXME: Workaround for source compat issue with + // functions that used to shadow the original flatMap + // (rdar://125016028) + public func flatMap( + _ transform: (Wrapped) throws(E) -> U? + ) throws(E) -> U? { + switch self { + case .some(let y): + return try transform(y) + case .none: + return .none + } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @usableFromInline + internal func flatMap( _ transform: (Wrapped) throws -> U? ) rethrows -> U? { switch self { @@ -286,7 +316,7 @@ extension Optional where Wrapped: ~Copyable { _ transform: (borrowing Wrapped) throws(E) -> U? ) throws(E) -> U? { switch self { - case .some(_borrowing y): + case .some(borrowing y): return try transform(y) case .none: return .none @@ -770,10 +800,9 @@ extension Optional where Wrapped: ~Copyable { /// type as the `Wrapped` type of `optional`. @_transparent @_alwaysEmitIntoClient -// FIXME: This needs to support typed throws. public func ?? ( optional: consuming T?, - defaultValue: @autoclosure () throws -> T + defaultValue: @autoclosure () throws -> T // FIXME: typed throw ) rethrows -> T { switch consume optional { case .some(let value): @@ -784,8 +813,9 @@ public func ?? ( } @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) +@_silgen_name("$ss2qqoiyxxSg_xyKXKtKlF") @usableFromInline -internal func ?? ( +internal func _legacy_abi_optionalNilCoalescingOperator ( optional: T?, defaultValue: @autoclosure () throws -> T ) rethrows -> T { diff --git a/stdlib/public/core/Result.swift b/stdlib/public/core/Result.swift index 52c086db7f6bd..03d0ef6317e73 100644 --- a/stdlib/public/core/Result.swift +++ b/stdlib/public/core/Result.swift @@ -48,8 +48,24 @@ extension Result { /// instance. /// - Returns: A `Result` instance with the result of evaluating `transform` /// as the new success value if this instance represents a success. - @inlinable - public func map( + @_alwaysEmitIntoClient + @_disfavoredOverload // FIXME: Workaround for source compat issue with + // functions that used to shadow the original map + // (rdar://125016028) + public func map( + _ transform: (Success) -> NewSuccess + ) -> Result { + switch self { + case let .success(success): + return .success(transform(success)) + case let .failure(failure): + return .failure(failure) + } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @usableFromInline + internal func map( _ transform: (Success) -> NewSuccess ) -> Result { switch self { @@ -82,7 +98,7 @@ extension Result where Success: ~Copyable { _ transform: (borrowing Success) -> NewSuccess ) -> Result { switch self { - case .success(_borrowing success): + case .success(borrowing success): return .success(transform(success)) case let .failure(failure): return .failure(failure) @@ -173,8 +189,24 @@ extension Result { /// instance. /// - Returns: A `Result` instance, either from the closure or the previous /// `.failure`. - @inlinable - public func flatMap( + @_alwaysEmitIntoClient + @_disfavoredOverload // FIXME: Workaround for source compat issue with + // functions that used to shadow the original flatMap + // (rdar://125016028) + public func flatMap( + _ transform: (Success) -> Result + ) -> Result { + switch self { + case let .success(success): + return transform(success) + case let .failure(failure): + return .failure(failure) + } + } + + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @usableFromInline + internal func flatMap( _ transform: (Success) -> Result ) -> Result { switch self { @@ -207,7 +239,7 @@ extension Result where Success: ~Copyable { _ transform: (borrowing Success) -> Result ) -> Result { switch self { - case .success(_borrowing success): + case .success(borrowing success): return transform(success) case let .failure(failure): return .failure(failure) @@ -215,7 +247,7 @@ extension Result where Success: ~Copyable { } } -extension Result { +extension Result where Success: ~Copyable { /// Returns a new result, mapping any failure value using the given /// transformation and unwrapping the produced result. /// @@ -223,8 +255,24 @@ extension Result { /// instance. /// - Returns: A `Result` instance, either from the closure or the previous /// `.success`. - @inlinable - public func flatMapError( + @_alwaysEmitIntoClient + public consuming func flatMapError( + _ transform: (Failure) -> Result + ) -> Result { + switch consume self { + case let .success(success): + return .success(success) + case let .failure(failure): + return transform(failure) + } + } +} + +extension Result { + @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1) + @_silgen_name("$ss6ResultO12flatMapErroryAByxqd__GADq_XEs0D0Rd__lF") + @usableFromInline + internal func flatMapError( _ transform: (Failure) -> Result ) -> Result { switch self { diff --git a/stdlib/public/core/TemporaryAllocation.swift b/stdlib/public/core/TemporaryAllocation.swift index 4c7001a7043db..ace947cd22152 100644 --- a/stdlib/public/core/TemporaryAllocation.swift +++ b/stdlib/public/core/TemporaryAllocation.swift @@ -124,8 +124,9 @@ internal func _isStackAllocationSafe(byteCount: Int, alignment: Int) -> Bool { /// This function encapsulates the various calls to builtins required by /// `withUnsafeTemporaryAllocation()`. @_alwaysEmitIntoClient @_transparent -// FIXME(NCG): R needs to be ~Copyable too, but that leads to lifetime failures (rdar://124571365). -internal func _withUnsafeTemporaryAllocation( +internal func _withUnsafeTemporaryAllocation< + T: ~Copyable, R: ~Copyable +>( of type: T.Type, capacity: Int, alignment: Int, @@ -169,8 +170,7 @@ internal func _withUnsafeTemporaryAllocation( @_alwaysEmitIntoClient @_transparent internal func _withUnprotectedUnsafeTemporaryAllocation< - // FIXME(NCG): R needs to be ~Copyable too, but that leads to lifetime failures (rdar://124571365). - T: ~Copyable, R + T: ~Copyable, R: ~Copyable >( of type: T.Type, capacity: Int, @@ -267,8 +267,7 @@ internal func _fallBackToHeapAllocation( /// the buffer) must not escape. It will be deallocated when `body` returns and /// cannot be used afterward. @_alwaysEmitIntoClient @_transparent -// FIXME(NCG): R needs to be ~Copyable, but that leads to lifetime failures (rdar://124571365). -public func withUnsafeTemporaryAllocation( +public func withUnsafeTemporaryAllocation( byteCount: Int, alignment: Int, _ body: (UnsafeMutableRawBufferPointer) throws -> R @@ -292,8 +291,7 @@ public func withUnsafeTemporaryAllocation( /// This function is similar to `withUnsafeTemporaryAllocation`, except that it /// doesn't trigger stack protection for the stack allocated memory. @_alwaysEmitIntoClient @_transparent -// FIXME(NCG): R needs to be ~Copyable, but that leads to lifetime failures (rdar://124571365). -public func _withUnprotectedUnsafeTemporaryAllocation( +public func _withUnprotectedUnsafeTemporaryAllocation( byteCount: Int, alignment: Int, _ body: (UnsafeMutableRawBufferPointer) throws -> R @@ -343,8 +341,9 @@ public func _withUnprotectedUnsafeTemporaryAllocation( /// the buffer) must not escape. It will be deallocated when `body` returns and /// cannot be used afterward. @_alwaysEmitIntoClient @_transparent -// FIXME(NCG): R needs to be ~Copyable too, but that leads to lifetime failures (rdar://124571365). -public func withUnsafeTemporaryAllocation( +public func withUnsafeTemporaryAllocation< + T: ~Copyable,R: ~Copyable +>( of type: T.Type, capacity: Int, _ body: (UnsafeMutableBufferPointer) throws -> R @@ -369,8 +368,9 @@ public func withUnsafeTemporaryAllocation( /// This function is similar to `withUnsafeTemporaryAllocation`, except that it /// doesn't trigger stack protection for the stack allocated memory. @_alwaysEmitIntoClient @_transparent -// FIXME(NCG): R needs to be ~Copyable too, but that leads to lifetime failures (rdar://124571365). -public func _withUnprotectedUnsafeTemporaryAllocation( +public func _withUnprotectedUnsafeTemporaryAllocation< + T: ~Copyable, R: ~Copyable +>( of type: T.Type, capacity: Int, _ body: (UnsafeMutableBufferPointer) throws -> R diff --git a/stdlib/public/core/UnsafeBufferPointer.swift.gyb b/stdlib/public/core/UnsafeBufferPointer.swift.gyb index c390c7267da89..322567e3fb47a 100644 --- a/stdlib/public/core/UnsafeBufferPointer.swift.gyb +++ b/stdlib/public/core/UnsafeBufferPointer.swift.gyb @@ -1262,10 +1262,10 @@ extension Unsafe${Mutable}BufferPointer where Element: ~Copyable { /// - buffer: The buffer temporarily bound to `T`. /// - Returns: The return value, if any, of the `body` closure parameter. @_alwaysEmitIntoClient - public func withMemoryRebound( + public func withMemoryRebound( to type: T.Type, - _ body: (_ buffer: ${Self}) throws -> Result - ) rethrows -> Result { + _ body: (_ buffer: ${Self}) throws(E) -> Result + ) throws(E) -> Result { guard let base = _position?._rawValue else { return try body(.init(start: nil, count: 0)) } @@ -1314,8 +1314,11 @@ extension Unsafe${Mutable}BufferPointer { } @_unavailableInEmbedded -extension Unsafe${Mutable}BufferPointer: CustomDebugStringConvertible { +@_preInverseGenerics +extension Unsafe${Mutable}BufferPointer: CustomDebugStringConvertible +where Element: ~Copyable { /// A textual representation of the buffer, suitable for debugging. + @_preInverseGenerics public var debugDescription: String { return "Unsafe${Mutable}BufferPointer" + "(start: \(_position.map(String.init(describing:)) ?? "nil"), count: \(count))" diff --git a/stdlib/public/core/UnsafePointer.swift b/stdlib/public/core/UnsafePointer.swift index 01f354ca3f814..79a8344515b4d 100644 --- a/stdlib/public/core/UnsafePointer.swift +++ b/stdlib/public/core/UnsafePointer.swift @@ -394,11 +394,11 @@ extension UnsafePointer where Pointee: ~Copyable { /// - pointer: The pointer temporarily bound to `T`. /// - Returns: The return value, if any, of the `body` closure parameter. @_alwaysEmitIntoClient - public func withMemoryRebound( + public func withMemoryRebound( to type: T.Type, capacity count: Int, - _ body: (_ pointer: UnsafePointer) throws -> Result - ) rethrows -> Result { + _ body: (_ pointer: UnsafePointer) throws(E) -> Result + ) throws(E) -> Result { _debugPrecondition( Int(bitPattern: .init(_rawValue)) & (MemoryLayout.alignment-1) == 0 && ( count == 1 || @@ -1237,11 +1237,11 @@ extension UnsafeMutablePointer where Pointee: ~Copyable { /// - pointer: The pointer temporarily bound to `T`. /// - Returns: The return value, if any, of the `body` closure parameter. @_alwaysEmitIntoClient - public func withMemoryRebound( + public func withMemoryRebound( to type: T.Type, capacity count: Int, - _ body: (_ pointer: UnsafeMutablePointer) throws -> Result - ) rethrows -> Result { + _ body: (_ pointer: UnsafeMutablePointer) throws(E) -> Result + ) throws(E) -> Result { _debugPrecondition( Int(bitPattern: .init(_rawValue)) & (MemoryLayout.alignment-1) == 0 && ( count == 1 || diff --git a/test/Constraints/closures.swift b/test/Constraints/closures.swift index e9e148fd14109..b79a297961fb1 100644 --- a/test/Constraints/closures.swift +++ b/test/Constraints/closures.swift @@ -379,7 +379,7 @@ let _ = [0].map { func rdar21078316() { var foo : [String : String]? var bar : [(String, String)]? - bar = foo.map { ($0, $1) } // expected-error {{contextual closure type '([String : String]) throws -> [(String, String)]' expects 1 argument, but 2 were used in closure body}} + bar = foo.map { ($0, $1) } // expected-error {{contextual closure type '([String : String]) -> [(String, String)]' expects 1 argument, but 2 were used in closure body}} // expected-error@-1{{cannot convert value of type '(Dictionary, _)' to closure result type '[(String, String)]'}} } diff --git a/test/IDE/complete_unresolved_members.swift b/test/IDE/complete_unresolved_members.swift index 9cabfbd9f20d9..28795131a6df1 100644 --- a/test/IDE/complete_unresolved_members.swift +++ b/test/IDE/complete_unresolved_members.swift @@ -155,8 +155,8 @@ class C4 { // UNRESOLVED_3_OPT-DAG: Keyword[nil]/None/Erase[1]/TypeRelation[Convertible]: nil[#SomeEnum1?#]; name=nil // UNRESOLVED_3_OPT-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: none[#Optional#]; name=none // UNRESOLVED_3_OPT-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: some({#SomeEnum1#})[#Optional#]; -// UNRESOLVED_3_OPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((SomeEnum1) throws -> U) -> U?#]; -// UNRESOLVED_3_OPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((SomeEnum1) throws -> U?) -> U?#]; +// UNRESOLVED_3_OPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((SomeEnum1) throws(Error) -> ~Copyable) -> ~Copyable?#]; name=map(:) +// UNRESOLVED_3_OPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((SomeEnum1) throws(Error) -> ~Copyable?) -> ~Copyable?#]; // UNRESOLVED_3_OPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem/TypeRelation[Invalid]: hash({#(self): Optional#})[#(into: inout Hasher) -> Void#]; // Exhaustive to make sure we don't include `init({#(some):` or `init({#nilLiteral:` entries @@ -167,8 +167,8 @@ class C4 { // UNRESOLVED_3_OPTOPTOPT-DAG: Keyword[nil]/None/Erase[1]/TypeRelation[Convertible]: nil[#SomeEnum1???#]; name=nil // UNRESOLVED_3_OPTOPTOPT-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: none[#Optional#]; name=none // UNRESOLVED_3_OPTOPTOPT-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: some({#SomeEnum1??#})[#Optional#]; -// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((SomeEnum1??) throws -> U) -> U?#]; -// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((SomeEnum1??) throws -> U?) -> U?#]; +// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((SomeEnum1??) throws(Error) -> ~Copyable) -> ~Copyable?#]; +// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((SomeEnum1??) throws(Error) -> ~Copyable?) -> ~Copyable?#]; // UNRESOLVED_3_OPTOPTOPT-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem/TypeRelation[Invalid]: hash({#(self): Optional#})[#(into: inout Hasher) -> Void#]; enum Somewhere { @@ -189,8 +189,8 @@ func testOptionalWithCustomExtension() { // UNRESOLVED_OPT_4-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: some({#Somewhere#})[#Optional#]; // UNRESOLVED_OPT_4-DAG: Decl[Constructor]/CurrNominal/TypeRelation[Convertible]: init({#str: String#})[#Optional#]; name=init(str:) // UNRESOLVED_OPT_4-DAG: Decl[StaticVar]/CurrNominal/TypeRelation[Convertible]: nowhere[#Optional#]; name=nowhere -// UNRESOLVED_OPT_4-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((Somewhere) throws -> U) -> U?#]; -// UNRESOLVED_OPT_4-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((Somewhere) throws -> U?) -> U?#]; +// UNRESOLVED_OPT_4-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((Somewhere) throws(Error) -> ~Copyable) -> ~Copyable?#]; +// UNRESOLVED_OPT_4-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((Somewhere) throws(Error) -> ~Copyable?) -> ~Copyable?#]; // UNRESOLVED_OPT_4-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem/TypeRelation[Invalid]: hash({#(self): Optional#})[#(into: inout Hasher) -> Void#]; // UNRESOLVED_OPT_4-NOT: init({#(some): // UNRESOLVED_OPT_4-NOT: init({#nilLiteral: @@ -695,8 +695,8 @@ func testSameType() { // SUGAR_TYPE-DAG: Keyword[nil]/None/Erase[1]/TypeRelation[Convertible]: nil[#SomeEnum1?#]; // SUGAR_TYPE-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: none[#Optional#]; // SUGAR_TYPE-DAG: Decl[EnumElement]/CurrNominal/IsSystem/TypeRelation[Convertible]: some({#SomeEnum1#})[#Optional#]; -// SUGAR_TYPE-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((SomeEnum1) throws -> U) -> U?#]; -// SUGAR_TYPE-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((SomeEnum1) throws -> U?) -> U?#]; +// SUGAR_TYPE-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: map({#(self): Optional#})[#((SomeEnum1) throws(Error) -> ~Copyable) -> ~Copyable?#]; +// SUGAR_TYPE-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem: flatMap({#(self): Optional#})[#((SomeEnum1) throws(Error) -> ~Copyable?) -> ~Copyable?#]; // SUGAR_TYPE-DAG: Decl[InstanceMethod]/CurrNominal/IsSystem/TypeRelation[Invalid]: hash({#(self): Optional#})[#(into: inout Hasher) -> Void#]; } diff --git a/test/SILOptimizer/closure_lifetime_fixup.swift b/test/SILOptimizer/closure_lifetime_fixup.swift index b105155edc946..d9df17c6de5b4 100644 --- a/test/SILOptimizer/closure_lifetime_fixup.swift +++ b/test/SILOptimizer/closure_lifetime_fixup.swift @@ -97,8 +97,8 @@ public func dontCrash(test: Bool, body: @escaping ((In) -> Out, In) -> // CHECK-LABEL: sil @$s22closure_lifetime_fixup28to_stack_of_convert_function1pySvSg_tF // CHECK: [[FN:%.*]] = function_ref @$s22closure_lifetime_fixup28to_stack_of_convert_function1pySvSg_tFSSSvcfu_ : // CHECK: [[PA:%.*]] = thin_to_thick_function [[FN]] -// CHECK: [[MAP:%.*]] = function_ref @$sSq3mapyqd__Sgqd__xKXEKlF -// CHECK: try_apply [[MAP]]({{.*}}, [[PA]], {{.*}}) +// CHECK: [[MAP:%.*]] = function_ref @$sSq3mapyqd_0_Sgqd_0_xqd__YKXEqd__YKs5ErrorRd__Ri_d_0_r0_lF +// CHECK: try_apply [[MAP]]({{.*}}, [[PA]], {{.*}}) public func to_stack_of_convert_function(p: UnsafeMutableRawPointer?) { _ = p.map(String.init(describing:)) } diff --git a/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected b/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected index ff5876f7e47a5..571046f295046 100644 --- a/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected +++ b/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected @@ -264,7 +264,6 @@ Func UnsafeBufferPointer.index(_:offsetBy:) has generic signature change from to Func UnsafeBufferPointer.index(after:) has generic signature change from to Func UnsafeBufferPointer.index(before:) has generic signature change from to -Func UnsafeBufferPointer.withMemoryRebound(to:_:) has generic signature change from to Func UnsafeMutableBufferPointer.allocate(capacity:) has generic signature change from to Func UnsafeMutableBufferPointer.deallocate() has generic signature change from to Func UnsafeMutableBufferPointer.distance(from:to:) has generic signature change from to @@ -275,7 +274,6 @@ Func UnsafeMutableBufferPointer.index(_:offsetBy:limitedBy:) has generic signatu Func UnsafeMutableBufferPointer.index(after:) has generic signature change from to Func UnsafeMutableBufferPointer.index(before:) has generic signature change from to Func UnsafeMutableBufferPointer.swapAt(_:_:) has generic signature change from to -Func UnsafeMutableBufferPointer.withMemoryRebound(to:_:) has generic signature change from to Func UnsafeMutablePointer.allocate(capacity:) has generic signature change from to Func UnsafeMutablePointer.deallocate() has generic signature change from to Func UnsafeMutablePointer.deinitialize(count:) has generic signature change from to @@ -283,18 +281,15 @@ Func UnsafeMutablePointer.initialize(to:) has generic signature change from to Func UnsafeMutablePointer.moveInitialize(from:count:) has generic signature change from to -Func UnsafeMutablePointer.withMemoryRebound(to:capacity:_:) has generic signature change from to Func UnsafeMutableRawBufferPointer.bindMemory(to:) has generic signature change from to Func UnsafeMutableRawPointer.assumingMemoryBound(to:) has generic signature change from to Func UnsafeMutableRawPointer.bindMemory(to:capacity:) has generic signature change from to Func UnsafeMutableRawPointer.moveInitializeMemory(as:from:count:) has generic signature change from to Func UnsafePointer.deallocate() has generic signature change from to -Func UnsafePointer.withMemoryRebound(to:capacity:_:) has generic signature change from to Func UnsafeRawBufferPointer.bindMemory(to:) has generic signature change from to Func UnsafeRawPointer.assumingMemoryBound(to:) has generic signature change from to Func UnsafeRawPointer.bindMemory(to:capacity:) has generic signature change from to Func swap(_:_:) has generic signature change from to -Func withExtendedLifetime(_:_:) has generic signature change from to Func withExtendedLifetime(_:_:) has parameter 0 changing from Default to Shared Func withUnsafeBytes(of:_:) has generic signature change from to Func withUnsafeBytes(of:_:) has parameter 0 changing from Default to Shared @@ -318,3 +313,34 @@ TypeAlias UnsafePointer.Distance has generic signature change from to TypeAlias UnsafePointer.Pointee has generic signature change from to TypeAlias UnsafePointer.Stride has generic signature change from to Func FixedWidthInteger.&*(_:_:) has been added as a protocol requirement +Accessor UnsafeBufferPointer.debugDescription.Get() has generic signature change from to +Accessor UnsafeMutableBufferPointer.debugDescription.Get() has generic signature change from to +Func ManagedBuffer.withUnsafeMutablePointerToElements(_:) has generic signature change from to +Func ManagedBuffer.withUnsafeMutablePointerToElements(_:) is now without @rethrows +Func ManagedBuffer.withUnsafeMutablePointerToHeader(_:) has generic signature change from to +Func ManagedBuffer.withUnsafeMutablePointerToHeader(_:) is now without @rethrows +Func ManagedBuffer.withUnsafeMutablePointers(_:) has generic signature change from to +Func ManagedBuffer.withUnsafeMutablePointers(_:) is now without @rethrows +Func ManagedBufferPointer.withUnsafeMutablePointerToElements(_:) has generic signature change from to +Func ManagedBufferPointer.withUnsafeMutablePointerToElements(_:) is now without @rethrows +Func ManagedBufferPointer.withUnsafeMutablePointerToHeader(_:) has generic signature change from to +Func ManagedBufferPointer.withUnsafeMutablePointerToHeader(_:) is now without @rethrows +Func ManagedBufferPointer.withUnsafeMutablePointers(_:) has generic signature change from to +Func ManagedBufferPointer.withUnsafeMutablePointers(_:) is now without @rethrows +Func Optional.flatMap(_:) has generic signature change from to +Func Optional.flatMap(_:) is now without @rethrows +Func Optional.map(_:) has generic signature change from to +Func Optional.map(_:) is now without @rethrows +Func Result.flatMap(_:) has generic signature change from to +Func Result.flatMapError(_:) has self access kind changing from NonMutating to Consuming +Func Result.map(_:) has generic signature change from to +Func UnsafeBufferPointer.withMemoryRebound(to:_:) has generic signature change from to +Func UnsafeBufferPointer.withMemoryRebound(to:_:) is now without @rethrows +Func UnsafeMutableBufferPointer.withMemoryRebound(to:_:) has generic signature change from to +Func UnsafeMutableBufferPointer.withMemoryRebound(to:_:) is now without @rethrows +Func UnsafeMutablePointer.withMemoryRebound(to:capacity:_:) has generic signature change from to +Func UnsafeMutablePointer.withMemoryRebound(to:capacity:_:) is now without @rethrows +Func UnsafePointer.withMemoryRebound(to:capacity:_:) has generic signature change from to +Func UnsafePointer.withMemoryRebound(to:capacity:_:) is now without @rethrows +Func withExtendedLifetime(_:_:) has generic signature change from to +Func withExtendedLifetime(_:_:) has generic signature change from to diff --git a/test/api-digester/stability-stdlib-abi-without-asserts.test b/test/api-digester/stability-stdlib-abi-without-asserts.test index f6e013760c9dd..8daf0f762ecee 100644 --- a/test/api-digester/stability-stdlib-abi-without-asserts.test +++ b/test/api-digester/stability-stdlib-abi-without-asserts.test @@ -556,12 +556,9 @@ Func ??(_:_:) has been removed Func ManagedBuffer.create(minimumCapacity:makingHeaderWith:) has generic signature change from to Func ManagedBuffer.create(minimumCapacity:makingHeaderWith:) has mangled name changing from 'static Swift.ManagedBuffer.create(minimumCapacity: Swift.Int, makingHeaderWith: (Swift.ManagedBuffer) throws -> A) throws -> Swift.ManagedBuffer' to 'static (extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.create(minimumCapacity: Swift.Int, makingHeaderWith: (Swift.ManagedBuffer) throws -> A) throws -> Swift.ManagedBuffer' Func ManagedBuffer.create(minimumCapacity:makingHeaderWith:) is now with @_preInverseGenerics -Func ManagedBuffer.withUnsafeMutablePointerToElements(_:) has mangled name changing from 'Swift.ManagedBuffer.withUnsafeMutablePointerToElements((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' to '(extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.withUnsafeMutablePointerToElements((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' -Func ManagedBuffer.withUnsafeMutablePointerToElements(_:) is now with @_preInverseGenerics -Func ManagedBuffer.withUnsafeMutablePointerToHeader(_:) has mangled name changing from 'Swift.ManagedBuffer.withUnsafeMutablePointerToHeader((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' to '(extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.withUnsafeMutablePointerToHeader((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' -Func ManagedBuffer.withUnsafeMutablePointerToHeader(_:) is now with @_preInverseGenerics -Func ManagedBuffer.withUnsafeMutablePointers(_:) has mangled name changing from 'Swift.ManagedBuffer.withUnsafeMutablePointers((Swift.UnsafeMutablePointer, Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' to '(extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.withUnsafeMutablePointers((Swift.UnsafeMutablePointer, Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' -Func ManagedBuffer.withUnsafeMutablePointers(_:) is now with @_preInverseGenerics +Func ManagedBuffer.withUnsafeMutablePointerToElements(_:) has been removed +Func ManagedBuffer.withUnsafeMutablePointerToHeader(_:) has been removed +Func ManagedBuffer.withUnsafeMutablePointers(_:) has been removed Func ManagedBufferPointer._checkValidBufferClass(_:creating:) has generic signature change from to Func ManagedBufferPointer._checkValidBufferClass(_:creating:) has mangled name changing from 'static Swift.ManagedBufferPointer._checkValidBufferClass(_: Swift.AnyObject.Type, creating: Swift.Bool) -> ()' to 'static (extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>._checkValidBufferClass(_: Swift.AnyObject.Type, creating: Swift.Bool) -> ()' Func ManagedBufferPointer._checkValidBufferClass(_:creating:) is now with @_preInverseGenerics @@ -571,12 +568,9 @@ Func ManagedBufferPointer._internalInvariantValidBufferClass(_:creating:) is now Func ManagedBufferPointer.isUniqueReference() has generic signature change from to Func ManagedBufferPointer.isUniqueReference() has mangled name changing from 'Swift.ManagedBufferPointer.isUniqueReference() -> Swift.Bool' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>.isUniqueReference() -> Swift.Bool' Func ManagedBufferPointer.isUniqueReference() is now with @_preInverseGenerics -Func ManagedBufferPointer.withUnsafeMutablePointerToElements(_:) has mangled name changing from 'Swift.ManagedBufferPointer.withUnsafeMutablePointerToElements((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>.withUnsafeMutablePointerToElements((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' -Func ManagedBufferPointer.withUnsafeMutablePointerToElements(_:) is now with @_preInverseGenerics -Func ManagedBufferPointer.withUnsafeMutablePointerToHeader(_:) has mangled name changing from 'Swift.ManagedBufferPointer.withUnsafeMutablePointerToHeader((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>.withUnsafeMutablePointerToHeader((Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' -Func ManagedBufferPointer.withUnsafeMutablePointerToHeader(_:) is now with @_preInverseGenerics -Func ManagedBufferPointer.withUnsafeMutablePointers(_:) has mangled name changing from 'Swift.ManagedBufferPointer.withUnsafeMutablePointers((Swift.UnsafeMutablePointer, Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>.withUnsafeMutablePointers((Swift.UnsafeMutablePointer, Swift.UnsafeMutablePointer) throws -> A1) throws -> A1' -Func ManagedBufferPointer.withUnsafeMutablePointers(_:) is now with @_preInverseGenerics +Func ManagedBufferPointer.withUnsafeMutablePointerToElements(_:) has been removed +Func ManagedBufferPointer.withUnsafeMutablePointerToHeader(_:) has been removed +Func ManagedBufferPointer.withUnsafeMutablePointers(_:) has been removed Func MemoryLayout.alignment(ofValue:) has generic signature change from to Func MemoryLayout.alignment(ofValue:) has mangled name changing from 'static Swift.MemoryLayout.alignment(ofValue: A) -> Swift.Int' to 'static (extension in Swift):Swift.MemoryLayout< where A: ~Swift.Copyable>.alignment(ofValue: A) -> Swift.Int' Func MemoryLayout.alignment(ofValue:) has parameter 0 changing from Default to Shared @@ -708,10 +702,6 @@ Func _fixLifetime(_:) is now with @_preInverseGenerics Func swap(_:_:) has generic signature change from to Func swap(_:_:) has mangled name changing from 'Swift.swap(inout A, inout A) -> ()' to 'Swift.swap(inout A, inout A) -> ()' Func swap(_:_:) is now with @_preInverseGenerics -Func withExtendedLifetime(_:_:) has generic signature change from to -Func withExtendedLifetime(_:_:) has mangled name changing from 'Swift.withExtendedLifetime(A, () throws -> B) throws -> B' to 'Swift.withExtendedLifetime(A, () throws -> B) throws -> B' -Func withExtendedLifetime(_:_:) has parameter 0 changing from Default to Shared -Func withExtendedLifetime(_:_:) is now with @_preInverseGenerics Func withUnsafeBytes(of:_:) has been renamed to Func __abi_se0413_withUnsafeBytes(of:_:) Func withUnsafeBytes(of:_:) has mangled name changing from 'Swift.withUnsafeBytes(of: A, _: (Swift.UnsafeRawBufferPointer) throws -> B) throws -> B' to 'Swift.__abi_se0413_withUnsafeBytes(of: A, _: (Swift.UnsafeRawBufferPointer) throws -> B) throws -> B' Func withUnsafeBytes(of:_:) has mangled name changing from 'Swift.withUnsafeBytes(of: inout A, _: (Swift.UnsafeRawBufferPointer) throws -> B) throws -> B' to 'Swift.__abi_se0413_withUnsafeBytes(of: inout A, _: (Swift.UnsafeRawBufferPointer) throws -> B) throws -> B' @@ -807,6 +797,23 @@ Var UnsafePointer._rawValue is now with @_preInverseGenerics Var UnsafePointer.hashValue has mangled name changing from 'Swift.UnsafePointer.hashValue : Swift.Int' to '(extension in Swift):Swift.UnsafePointer< where A: ~Swift.Copyable>.hashValue : Swift.Int' Var UnsafePointer.hashValue is now with @_preInverseGenerics Var UnsafePointer.pointee has been removed +Accessor UnsafeBufferPointer.debugDescription.Get() has generic signature change from to +Accessor UnsafeBufferPointer.debugDescription.Get() has mangled name changing from 'Swift.UnsafeBufferPointer.debugDescription.getter : Swift.String' to '(extension in Swift):Swift.UnsafeBufferPointer< where A: ~Swift.Copyable>.debugDescription.getter : Swift.String' +Accessor UnsafeMutableBufferPointer.debugDescription.Get() has generic signature change from to +Accessor UnsafeMutableBufferPointer.debugDescription.Get() has mangled name changing from 'Swift.UnsafeMutableBufferPointer.debugDescription.getter : Swift.String' to '(extension in Swift):Swift.UnsafeMutableBufferPointer< where A: ~Swift.Copyable>.debugDescription.getter : Swift.String' +Constructor OpaquePointer.init(_:) has mangled name changing from 'Swift.OpaquePointer.init(Swift.Optional>) -> Swift.Optional' to 'Swift.OpaquePointer.init(Swift.Optional>) -> Swift.Optional' +Constructor OpaquePointer.init(_:) has mangled name changing from 'Swift.OpaquePointer.init(Swift.UnsafeMutablePointer) -> Swift.OpaquePointer' to 'Swift.OpaquePointer.init(Swift.UnsafeMutablePointer) -> Swift.OpaquePointer' +Func Optional.flatMap(_:) has been removed +Func Optional.map(_:) has been removed +Func Result.flatMap(_:) has been removed +Func Result.flatMapError(_:) has been removed +Func Result.map(_:) has been removed +Func withExtendedLifetime(_:_:) has been removed +Var UnsafeBufferPointer.debugDescription has mangled name changing from 'Swift.UnsafeBufferPointer.debugDescription : Swift.String' to '(extension in Swift):Swift.UnsafeBufferPointer< where A: ~Swift.Copyable>.debugDescription : Swift.String' +Var UnsafeBufferPointer.debugDescription is now with @_preInverseGenerics +Var UnsafeMutableBufferPointer.debugDescription has mangled name changing from 'Swift.UnsafeMutableBufferPointer.debugDescription : Swift.String' to '(extension in Swift):Swift.UnsafeMutableBufferPointer< where A: ~Swift.Copyable>.debugDescription : Swift.String' +Var UnsafeMutableBufferPointer.debugDescription is now with @_preInverseGenerics + Func FixedWidthInteger.&*(_:_:) has been added as a protocol requirement // *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)