We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f6a32f commit b068a4cCopy full SHA for b068a4c
test/Concurrency/custom_executor_enqueue_impls.swift
@@ -51,3 +51,15 @@ final class NewExecutor: SerialExecutor {
51
UnownedSerialExecutor(ordinary: self)
52
}
53
54
+
55
+// Good impl, but missing the ownership keyword
56
+final class MissingOwnership: SerialExecutor {
57
+ func enqueue(_ job: ExecutorJob) {} // expected-error{{noncopyable parameter must specify its ownership}}
58
+ // expected-note@-1{{add 'borrowing' for an immutable reference}}
59
+ // expected-note@-2{{add 'inout' for a mutable reference}}
60
+ // expected-note@-3{{add 'consuming' to take the value from the caller}}
61
62
+ func asUnownedSerialExecutor() -> UnownedSerialExecutor {
63
+ UnownedSerialExecutor(ordinary: self)
64
+ }
65
+}
0 commit comments