77 See https://swift.org/LICENSE.txt for license information
88*/
99
10- #if swift(>=5.8) && $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
10+ #if false && swift(>=5.8) && $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
1111
1212import Darwin. Mach
1313
@@ -27,8 +27,7 @@ internal func _machPrecondition(
2727@available ( /*System 1.3.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8 , * )
2828@frozen
2929public enum Mach {
30- @_moveOnly
31- public struct Port < RightType: MachPortRight > {
30+ public struct Port < RightType: MachPortRight > : ~ Copyable {
3231 @usableFromInline
3332 internal var _name : mach_port_name_t
3433
@@ -122,24 +121,6 @@ public enum Mach {
122121 /// receiving end.
123122 @frozen
124123 public struct SendOnceRight : MachPortRight { }
125-
126- /// Create a connected pair of rights, one receive, and one send.
127- ///
128- /// This function will abort if the rights could not be created.
129- /// Callers may assert that valid rights are always returned.
130- public static func allocatePortRightPair( ) ->
131- ( receive: Mach . Port < Mach . ReceiveRight > , send: Mach . Port < Mach . SendRight > ) {
132- var name = mach_port_name_t ( MACH_PORT_NULL)
133- let secret = mach_port_context_t ( arc4random ( ) )
134- withUnsafeMutablePointer ( to: & name) { name in
135- var options = mach_port_options_t ( )
136- options. flags = UInt32 ( MPO_INSERT_SEND_RIGHT) ;
137- withUnsafeMutablePointer ( to: & options) { options in
138- _machPrecondition ( mach_port_construct ( mach_task_self_, options, secret, name) )
139- }
140- }
141- return ( Mach . Port ( name: name, context: secret) , Mach . Port ( name: name) )
142- }
143124}
144125
145126extension Mach . Port where RightType == Mach . ReceiveRight {
0 commit comments