Skip to content

Commit bd2466a

Browse files
hchokshifacebook-github-bot
authored andcommitted
Replace direct usages of std coroutines with folly::coro in folly::result
Summary: Fixes compile errors when coroutines are under `experimental` in the active compiler. Reviewed By: praihan Differential Revision: D79929244 fbshipit-source-id: 8088e31088a85c2714c3300fd6fc3c9f97d3dae9
1 parent 6783df3 commit bd2466a

File tree

1 file changed

+4
-3
lines changed
  • third-party/folly/src/folly/result

1 file changed

+4
-3
lines changed

third-party/folly/src/folly/result/result.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <folly/ExceptionWrapper.h>
2020
#include <folly/Expected.h>
2121
#include <folly/OperationCancelled.h>
22+
#include <folly/coro/Coroutine.h>
2223
#include <folly/lang/Align.h> // for `hardware_constructive_interference_size`
2324
#include <folly/lang/RValueReferenceWrapper.h>
2425
#include <folly/portability/GTestProd.h>
@@ -739,10 +740,10 @@ struct result_promise_base {
739740
void operator=(result_promise_base&&) = delete;
740741
~result_promise_base() = default;
741742

742-
FOLLY_NODISCARD std::suspend_never initial_suspend() const noexcept {
743+
FOLLY_NODISCARD folly::coro::suspend_never initial_suspend() const noexcept {
743744
return {};
744745
}
745-
FOLLY_NODISCARD std::suspend_never final_suspend() const noexcept {
746+
FOLLY_NODISCARD folly::coro::suspend_never final_suspend() const noexcept {
746747
return {};
747748
}
748749
void unhandled_exception() noexcept {
@@ -778,7 +779,7 @@ struct result_promise<T, typename std::enable_if<std::is_void_v<T>>::type>
778779
};
779780

780781
template <typename T>
781-
using result_promise_handle = std::coroutine_handle<result_promise<T>>;
782+
using result_promise_handle = folly::coro::coroutine_handle<result_promise<T>>;
782783

783784
// This is separate to let `result_generator` reuse the awaitables below.
784785
struct result_await_suspender {

0 commit comments

Comments
 (0)