Skip to content

Overhaul CoroutineKind - #161082

Open
nnethercote wants to merge 5 commits into
rust-lang:mainfrom
nnethercote:overhaul-CoroutineMarker
Open

Overhaul CoroutineKind#161082
nnethercote wants to merge 5 commits into
rust-lang:mainfrom
nnethercote:overhaul-CoroutineMarker

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

Its structure is a bit weird. Details in individual commits.

r? @mejrs

It's equivalent to `eq_opt_coroutine_kind`.
We currently map an `Option` but then only call `is_some` on it.

Also wrap some overlong comment lines.
It is an enum with three variant, and all the variants have identical
fields, which is silly. This commit does the following.

- Renames it as `CoroutineMarker`, because the `Kind` suffix is used for
  enums. (The existing doc comment already uses the word "marker".)

- Renames the existing `GenBlockKind` as `CoroutineKind`, uses it
  within `CoroutineMarker`, and adds `CoroutineKind::is_gen`.

This removes the need for the `span`, `closure_id` and `return_id`
methods; direct field access now suffices.
@rustbot

rustbot commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

rustfmt is developed in its own repository. If possible, consider making this change to rust-lang/rustfmt instead.

cc @rust-lang/rustfmt

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants