File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ public protocol SerialExecutor: Executor {
144144
145145 /// Convert this executor value to the optimized form of borrowed
146146 /// executor references.
147+ @unsafe
147148 func asUnownedSerialExecutor( ) -> UnownedSerialExecutor
148149
149150 /// If this executor has complex equality semantics, and the runtime needs to
Original file line number Diff line number Diff line change @@ -37,3 +37,10 @@ func f() async { // expected-warning{{global function 'f' involves unsafe code;
3737
3838// expected-warning@+1{{type alias 'WeirdC' involves unsafe code; use '@unsafe' to indicate that its use is not memory-safe}}
3939typealias WeirdC = RequiresSendable < C > // expected-note{{@unchecked conformance of 'C' to protocol 'Sendable' involves unsafe code}}
40+
41+
42+ @available ( SwiftStdlib 5 . 9 , * )
43+ final class MyExecutor : SerialExecutor {
44+ func enqueue( _ job: consuming ExecutorJob ) { fatalError ( " boom " ) }
45+ @unsafe func asUnownedSerialExecutor( ) -> UnownedSerialExecutor { fatalError ( " boom " ) }
46+ }
You can’t perform that action at this time.
0 commit comments