rpc.hh: Document footgun in LIX_TRY_AWAIT_RPC

*piegames is tired of C++*

Change-Id: I9d6dd935afaadf809d5a779fbcc64f48b4af1cba
This commit is contained in:
piegames
2026-07-14 17:47:07 +00:00
committed by eldritch horrors
parent 734cfd1d48
commit c739701077
+2
View File
@@ -290,7 +290,9 @@ rewrapV1(kj::Promise<T> && promise, std::source_location loc = std::source_locat
#define LIX_WRAP_RPC_PROMISE_NOEXCEPT(...) (::nix::rpc::detail::rewrapNoexcept(__VA_ARGS__))
#define LIX_WRAP_RPC_PROMISE_V1(...) (::nix::rpc::detail::rewrapV1(__VA_ARGS__))
// IMPORTANT! Keep the result of this in a variable, or readers will dereference dangling pointers!
#define LIX_TRY_AWAIT_RPC_NOEXCEPT(...) (LIX_TRY_AWAIT(LIX_WRAP_RPC_PROMISE_NOEXCEPT(__VA_ARGS__)))
// IMPORTANT! Keep the result of this in a variable, or readers will dereference dangling pointers!
#define LIX_TRY_AWAIT_RPC_V1(...) (LIX_TRY_AWAIT(LIX_WRAP_RPC_PROMISE_V1(__VA_ARGS__)))
[[noreturn]]