Skip to content

let_value, let_error, & let_stopped: Dependent set_error_t(std::excep… - #2224

Merged
ericniebler merged 1 commit into
NVIDIA:mainfrom
RobertLeahy:dependent_let_20260822
Aug 23, 2026
Merged

let_value, let_error, & let_stopped: Dependent set_error_t(std::excep…#2224
ericniebler merged 1 commit into
NVIDIA:mainfrom
RobertLeahy:dependent_let_20260822

Conversation

@RobertLeahy

Copy link
Copy Markdown
Contributor

…tion_ptr)

let_value, let_error, and let_stopped have three different kinds of completion signatures:

  • Those obtained from the sender type returned by the invocable,
  • Those passed through from the child sender, and
  • Possibly set_error_t(std::exception_ptr)

The latter must be added when:

  • Decay-copying the apropos result datums of the child sender can throw,
  • Invoking the invocable with any set of decay-copied result datums can throw, or
  • Connecting any of the sender types which can be returned by the invocable can throw

Note that if the child of let_value, let_error, or let_stopped is not dependent the apropos result datums can be determined without the context of an environment. This means, in turn, that in such a situation it can be determined, without the context of an environment, whether invocation of the invocable can throw (since the type of the decay- copied result datums with which it will be invoked can be known).

The last of the bullets above, however, presents a problem in an environment-free context. Computing whether or not a sender can be connected without throwing requires the context of an environment (see P3388).

Previously let_value, let_error, and let_stopped unconditionally added set_error_t(std::exception_ptr) in the case where no environment was provided. This created the illusion that the sender was not dependent, and led to compilation failures in situations such as the test added by this commit.

The above might seem to imply that let_value, let_error, and let_stopped are always dependent, but this isn't true. In the case where set_error_t(std::exception_ptr) is already a possible completion signature it doesn't matter whether or not connecting the sender returned by the invocable can throw.

Reified the above: let_value, let_error, and let_stopped indicate they are dependent when the question of whether or not connecting the sender returned by the invocable throws determines the presence of set_error_t(std::exception_ptr), otherwise they can advertise non- dependent completion signatures.

Fixes #2197.

…tion_ptr)

let_value, let_error, and let_stopped have three different kinds of
completion signatures:

- Those obtained from the sender type returned by the invocable,
- Those passed through from the child sender, and
- Possibly set_error_t(std::exception_ptr)

The latter must be added when:

- Decay-copying the apropos result datums of the child sender can throw,
- Invoking the invocable with any set of decay-copied result datums can
  throw, or
- Connecting any of the sender types which can be returned by the
  invocable can throw

Note that if the child of let_value, let_error, or let_stopped is not
dependent the apropos result datums can be determined without the
context of an environment. This means, in turn, that in such a situation
it can be determined, without the context of an environment, whether
invocation of the invocable can throw (since the type of the decay-
copied result datums with which it will be invoked can be known).

The last of the bullets above, however, presents a problem in an
environment-free context. Computing whether or not a sender can be
connected without throwing requires the context of an environment (see
P3388).

Previously let_value, let_error, and let_stopped unconditionally added
set_error_t(std::exception_ptr) in the case where no environment was
provided. This created the illusion that the sender was not dependent,
and led to compilation failures in situations such as the test added by
this commit.

The above might seem to imply that let_value, let_error, and let_stopped
are always dependent, but this isn't true. In the case where
set_error_t(std::exception_ptr) is already a possible completion
signature it doesn't matter whether or not connecting the sender
returned by the invocable can throw.

Reified the above: let_value, let_error, and let_stopped indicate they
are dependent when the question of whether or not connecting the sender
returned by the invocable throws determines the presence of
set_error_t(std::exception_ptr), otherwise they can advertise non-
dependent completion signatures.
@copy-pr-bot

copy-pr-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 364da35

@ericniebler
ericniebler merged commit f91f636 into NVIDIA:main Aug 23, 2026
69 of 70 checks passed
@ericniebler

Copy link
Copy Markdown
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error completion signature of let_error changed recently

2 participants