Skip to content

refactor: remove internal Captures workaround trait#1383

Merged
rvolosatovs merged 1 commit into
mainfrom
remove-captures-trait
Jun 30, 2026
Merged

refactor: remove internal Captures workaround trait#1383
rvolosatovs merged 1 commit into
mainfrom
remove-captures-trait

Conversation

@rvolosatovs

Copy link
Copy Markdown
Member

wrpc-transport carried a #[doc(hidden)] Captures<'a> marker trait as a workaround for rust-lang/rust#63033, used to force returned impl Futures to capture an otherwise-unused lifetime. Precise capturing (use<..>, stable since Rust 1.82) makes it unnecessary.

Drop the trait and its uses:

  • transport: remove the trait/impl and the serve test bounds (edition 2024 captures the elided lifetime by default).
  • rust bindgen: replace + Captures<'a> on generated serve/serve_interface futures with + use<'a, T, H>, turning the argument-position impl Handler into a named generic so it can be named in the use<..> bound; the nested deferred futures now use + use<'a, C__>.

Generated bindings continue to compile under both edition 2021 and 2024.

Assisted-by: claude:claude-opus-4-8

`wrpc-transport` carried a `#[doc(hidden)] Captures<'a>` marker trait as a
workaround for rust-lang/rust#63033, used to force returned `impl Future`s to
capture an otherwise-unused lifetime. Precise capturing (`use<..>`, stable since
Rust 1.82) makes it unnecessary.

Drop the trait and its uses:
- transport: remove the trait/impl and the `serve` test bounds (edition 2024
  captures the elided lifetime by default).
- rust bindgen: replace `+ Captures<'a>` on generated `serve`/`serve_interface`
  futures with `+ use<'a, T, H>`, turning the argument-position `impl Handler`
  into a named generic so it can be named in the `use<..>` bound; the nested
  deferred futures now use `+ use<'a, C__>`.

Generated bindings continue to compile under both edition 2021 and 2024.

Assisted-by: claude:claude-opus-4-8
@rvolosatovs rvolosatovs enabled auto-merge June 30, 2026 14:58
@rvolosatovs rvolosatovs added this pull request to the merge queue Jun 30, 2026
Merged via the queue into main with commit b347c61 Jun 30, 2026
38 checks passed
@rvolosatovs rvolosatovs deleted the remove-captures-trait branch June 30, 2026 15:04
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.

1 participant