Skip to content

Commit 38631ac

Browse files
authored
Merge pull request #75136 from gottesmm/pr-f4ed7a74d1c86b132efccb042929ea28b764fc90
[sending] Change suppression to use __owned instead of consuming.
2 parents 8e5222e + 63146bc commit 38631ac

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3661,7 +3661,7 @@ static void printParameterFlags(ASTPrinter &printer,
36613661
// at +1. By not printing sending, we would be changing the API
36623662
// potentially to take the parameter at +0 instead of +1. To work around
36633663
// this, print out consuming so that we preserve the +1 parameter.
3664-
printer.printKeyword("consuming", options, " ");
3664+
printer.printKeyword("__owned", options, " ");
36653665
}
36663666
}
36673667

test/Concurrency/sending_conditional_suppression.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public class NonSendableKlass {}
99
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
1010
// CHECK-NEXT: public func transferArgTest(_ x: sending test.NonSendableKlass)
1111
// CHECK-NEXT: #else
12-
// When we suppress, we preserve +1 by marking the parameter as consuming. Otherwise, we
12+
// When we suppress, we preserve +1 by marking the parameter as __owned. Otherwise, we
1313
// be breaking ABI.
14-
// CHECK-NEXT: public func transferArgTest(_ x: consuming test.NonSendableKlass)
14+
// CHECK-NEXT: public func transferArgTest(_ x: __owned test.NonSendableKlass)
1515
// CHECK-NEXT: #endif
1616
public func transferArgTest(_ x: sending NonSendableKlass) {}
1717

@@ -25,14 +25,14 @@ public func transferResultTest() -> sending NonSendableKlass { fatalError() }
2525
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
2626
// CHECK-NEXT: public func transferArgAndResultTest(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, _ z: test.NonSendableKlass) -> sending test.NonSendableKlass
2727
// CHECK-NEXT: #else
28-
// CHECK-NEXT: public func transferArgAndResultTest(_ x: test.NonSendableKlass, _ y: consuming test.NonSendableKlass, _ z: test.NonSendableKlass) -> test.NonSendableKlass
28+
// CHECK-NEXT: public func transferArgAndResultTest(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, _ z: test.NonSendableKlass) -> test.NonSendableKlass
2929
// CHECK-NEXT: #endif
3030
public func transferArgAndResultTest(_ x: NonSendableKlass, _ y: sending NonSendableKlass, _ z: NonSendableKlass) -> sending NonSendableKlass { fatalError() }
3131

3232
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
3333
// CHECK-NEXT: public func argEmbeddedInType(_ fn: (sending test.NonSendableKlass) -> ())
3434
// CHECK-NEXT: #else
35-
// CHECK-NEXT: public func argEmbeddedInType(_ fn: (consuming test.NonSendableKlass) -> ())
35+
// CHECK-NEXT: public func argEmbeddedInType(_ fn: (__owned test.NonSendableKlass) -> ())
3636
// CHECK-NEXT: #endif
3737
public func argEmbeddedInType(_ fn: (sending NonSendableKlass) -> ()) {}
3838

@@ -46,15 +46,15 @@ public func resultEmbeddedInType(_ fn: () -> sending NonSendableKlass) {}
4646
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
4747
// CHECK-NEXT: public func argAndResultEmbeddedInType(_ fn: (test.NonSendableKlass, sending test.NonSendableKlass, test.NonSendableKlass) -> sending test.NonSendableKlass)
4848
// CHECK-NEXT: #else
49-
// CHECK-NEXT: public func argAndResultEmbeddedInType(_ fn: (test.NonSendableKlass, consuming test.NonSendableKlass, test.NonSendableKlass) -> test.NonSendableKlass)
49+
// CHECK-NEXT: public func argAndResultEmbeddedInType(_ fn: (test.NonSendableKlass, __owned test.NonSendableKlass, test.NonSendableKlass) -> test.NonSendableKlass)
5050
// CHECK-NEXT: #endif
5151
public func argAndResultEmbeddedInType(_ fn: (NonSendableKlass, sending NonSendableKlass, NonSendableKlass) -> sending NonSendableKlass) {}
5252

5353
public class TestInKlass {
5454
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
5555
// CHECK-NEXT: public func testKlassArg(_ x: sending test.NonSendableKlass)
5656
// CHECK-NEXT: #else
57-
// CHECK-NEXT: public func testKlassArg(_ x: consuming test.NonSendableKlass)
57+
// CHECK-NEXT: public func testKlassArg(_ x: __owned test.NonSendableKlass)
5858
// CHECK-NEXT: #endif
5959
public func testKlassArg(_ x: sending NonSendableKlass) { fatalError() }
6060

@@ -68,7 +68,7 @@ public class TestInKlass {
6868
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
6969
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, z: test.NonSendableKlass) -> sending test.NonSendableKlass
7070
// CHECK-NEXT: #else
71-
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: consuming test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
71+
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
7272
// CHECK-NEXT: #endif
7373
public func testKlassArgAndResult(_ x: NonSendableKlass, _ y: sending NonSendableKlass, z: NonSendableKlass) -> sending NonSendableKlass { fatalError() }
7474
}
@@ -77,7 +77,7 @@ public struct TestInStruct {
7777
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
7878
// CHECK-NEXT: public func testKlassArg(_ x: sending test.NonSendableKlass)
7979
// CHECK-NEXT: #else
80-
// CHECK-NEXT: public func testKlassArg(_ x: consuming test.NonSendableKlass)
80+
// CHECK-NEXT: public func testKlassArg(_ x: __owned test.NonSendableKlass)
8181
// CHECK-NEXT: #endif
8282
public func testKlassArg(_ x: sending NonSendableKlass) { fatalError() }
8383

@@ -91,7 +91,7 @@ public struct TestInStruct {
9191
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
9292
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, z: test.NonSendableKlass) -> sending test.NonSendableKlass
9393
// CHECK-NEXT: #else
94-
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: consuming test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
94+
// CHECK-NEXT: public func testKlassArgAndResult(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
9595
// CHECK-NEXT: #endif
9696
public func testKlassArgAndResult(_ x: NonSendableKlass, _ y: sending NonSendableKlass, z: NonSendableKlass) -> sending NonSendableKlass { fatalError() }
9797

@@ -114,7 +114,7 @@ public struct TestInStruct {
114114
// CHECK-NEXT: internal func testUsableFromInlineKlassArg(_ x: sending test.NonSendableKlass)
115115
// CHECK-NEXT: #else
116116
// CHECK-NEXT: @usableFromInline
117-
// CHECK-NEXT: internal func testUsableFromInlineKlassArg(_ x: consuming test.NonSendableKlass)
117+
// CHECK-NEXT: internal func testUsableFromInlineKlassArg(_ x: __owned test.NonSendableKlass)
118118
// CHECK-NEXT: #endif
119119
@usableFromInline func testUsableFromInlineKlassArg(_ x: sending NonSendableKlass) { fatalError() }
120120

@@ -133,7 +133,7 @@ public struct TestInStruct {
133133
// CHECK-NEXT: internal func testUsableFromInlineKlassArgAndResult(_ x: test.NonSendableKlass, _ y: sending test.NonSendableKlass, z: test.NonSendableKlass) -> sending test.NonSendableKlass
134134
// CHECK-NEXT: #else
135135
// CHECK-NEXT: @usableFromInline
136-
// CHECK-NEXT: internal func testUsableFromInlineKlassArgAndResult(_ x: test.NonSendableKlass, _ y: consuming test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
136+
// CHECK-NEXT: internal func testUsableFromInlineKlassArgAndResult(_ x: test.NonSendableKlass, _ y: __owned test.NonSendableKlass, z: test.NonSendableKlass) -> test.NonSendableKlass
137137
// CHECK-NEXT: #endif
138138
@usableFromInline
139139
func testUsableFromInlineKlassArgAndResult(_ x: NonSendableKlass, _ y: sending NonSendableKlass, z: NonSendableKlass) -> sending NonSendableKlass { fatalError() }
@@ -161,7 +161,7 @@ public struct TestInStruct {
161161
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
162162
// CHECK-NEXT: public var publicVarFieldFunctionArg: (sending test.NonSendableKlass) -> ()
163163
// CHECK-NEXT: #else
164-
// CHECK-NEXT: public var publicVarFieldFunctionArg: (consuming test.NonSendableKlass) -> ()
164+
// CHECK-NEXT: public var publicVarFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
165165
// CHECK-NEXT: #endif
166166
public var publicVarFieldFunctionArg: (sending NonSendableKlass) -> ()
167167

@@ -170,15 +170,15 @@ public struct TestInStruct {
170170
// CHECK-NEXT: internal var internalVarFieldFunctionArg: (sending test.NonSendableKlass) -> ()
171171
// CHECK-NEXT: #else
172172
// CHECK-NEXT: @usableFromInline
173-
// CHECK-NEXT: internal var internalVarFieldFunctionArg: (consuming test.NonSendableKlass) -> ()
173+
// CHECK-NEXT: internal var internalVarFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
174174
// CHECK-NEXT: #endif
175175
@usableFromInline
176176
var internalVarFieldFunctionArg: (sending NonSendableKlass) -> ()
177177

178178
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults
179179
// CHECK-NEXT: public let publicLetFieldFunctionArg: (sending test.NonSendableKlass) -> ()
180180
// CHECK-NEXT: #else
181-
// CHECK-NEXT: public let publicLetFieldFunctionArg: (consuming test.NonSendableKlass) -> ()
181+
// CHECK-NEXT: public let publicLetFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
182182
// CHECK-NEXT: #endif
183183
public let publicLetFieldFunctionArg: (sending NonSendableKlass) -> ()
184184

@@ -187,7 +187,7 @@ public struct TestInStruct {
187187
// CHECK-NEXT: internal let internalLetFieldFunctionArg: (sending test.NonSendableKlass) -> ()
188188
// CHECK-NEXT: #else
189189
// CHECK-NEXT: @usableFromInline
190-
// CHECK-NEXT: internal let internalLetFieldFunctionArg: (consuming test.NonSendableKlass) -> ()
190+
// CHECK-NEXT: internal let internalLetFieldFunctionArg: (__owned test.NonSendableKlass) -> ()
191191
// CHECK-NEXT: #endif
192192
@usableFromInline
193193
let internalLetFieldFunctionArg: (sending NonSendableKlass) -> ()
@@ -226,7 +226,7 @@ public struct TestInStruct {
226226
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 25
227227
// CHECK-NEXT: public var publicGlobal: (sending test.NonSendableKlass) -> ()
228228
// CHECK-NEXT: #else
229-
// CHECK-NEXT: public var publicGlobal: (consuming test.NonSendableKlass) -> ()
229+
// CHECK-NEXT: public var publicGlobal: (__owned test.NonSendableKlass) -> ()
230230
// CHECK-NEXT: #endif
231231
public var publicGlobal: (sending NonSendableKlass) -> () = { x in fatalError() }
232232

@@ -235,7 +235,7 @@ public var publicGlobal: (sending NonSendableKlass) -> () = { x in fatalError()
235235
// CHECK-NEXT: internal var usableFromInlineGlobal: (sending test.NonSendableKlass) -> ()
236236
// CHECK-NEXT: #else
237237
// CHECK-NEXT: @usableFromInline
238-
// CHECK-NEXT: internal var usableFromInlineGlobal: (consuming test.NonSendableKlass) -> ()
238+
// CHECK-NEXT: internal var usableFromInlineGlobal: (__owned test.NonSendableKlass) -> ()
239239
// CHECK-NEXT: #endif
240240
@usableFromInline
241241
internal var usableFromInlineGlobal: (sending NonSendableKlass) -> () = { x in fatalError() }

0 commit comments

Comments
 (0)