Skip to content

Commit c445602

Browse files
fix(exec): mark debug trial connects as root connects
With STDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON, the debug machinery's trial connect uses a debug environment that, unlike every real connect root (sync_wait, start_detached, start_now), did not answer the __root_t query. on()'s transform_sender relies on that query to decide whether it may fall back to an inline_scheduler when the environment has no scheduler to restore, so senders like on(sch, closure) over just(...) would trip __not_a_scheduler diagnostics during the extra type checking of sequence pipelines. The debug environment now includes __root_env, since the trial connect it performs is genuinely a root connect. Additionally, __root_t is now a forwarding query so that rootness survives environment adaptation such as write_env, matching the semantics that a connect tree's root property holds for every operation within it. With this change, all sequence test files compile cleanly with STDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON. Fixes #2274.
1 parent c1ffca5 commit c445602

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎include/stdexec/__detail/__debug.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace STDEXEC
7878

7979
STDEXEC_MODULE_EXPORT_AUTHORING
8080
template <class _Env>
81-
using __env_t = env<prop<__debug_env_t, bool>, _Env>;
81+
using __env_t = env<prop<__debug_env_t, bool>, __root_env, _Env>;
8282

8383
STDEXEC_MODULE_EXPORT_AUTHORING
8484
template <class _CvSender, class _Env, class... _Sigs>

‎include/stdexec/__detail/__env.hpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,13 @@ namespace STDEXEC
142142

143143
struct __root_t : __query<__root_t>
144144
{
145+
// This is a forwarding query so that the "rootness" of an environment survives
146+
// being wrapped by environment-adapting senders like `write_env`. Rootness is a
147+
// property of the root of a connect tree; it holds for every operation within it.
145148
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
146149
static consteval auto query(forwarding_query_t) noexcept -> bool
147150
{
148-
return false;
151+
return true;
149152
}
150153
};
151154

0 commit comments

Comments
 (0)