Skip to content

Commit 64d0f72

Browse files
committed
NFC: Address a warning in swift_task_asyncMainDrainQueueImpl().
The function is marked `noreturn` but the compiler was not able to reason statically about whether this constraint is met. From code inspection it's clear that the call to `swift_task_donateThreadToGlobalExecutorUntil()` does not return, so `swift_unreachable()` can be used to suppress the warning.
1 parent 3338722 commit 64d0f72

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/Concurrency/Task.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,8 @@ static void swift_task_asyncMainDrainQueueImpl() {
16351635
swift_task_donateThreadToGlobalExecutorUntil([](void *context) {
16361636
return *reinterpret_cast<bool*>(context);
16371637
}, &Finished);
1638+
swift_unreachable(
1639+
"Returned from swift_task_donateThreadToGlobalExecutorUntil()");
16381640
#elif !SWIFT_CONCURRENCY_ENABLE_DISPATCH
16391641
// FIXME: consider implementing a concurrent global main queue for
16401642
// these environments?

0 commit comments

Comments
 (0)