Skip to content

docs(epoch): fix defer_destroy Send rationale example#1256

Open
leno23 wants to merge 1 commit into
crossbeam-rs:masterfrom
leno23:docs-fix-defer-destroy-example-1253
Open

docs(epoch): fix defer_destroy Send rationale example#1256
leno23 wants to merge 1 commit into
crossbeam-rs:masterfrom
leno23:docs-fix-defer-destroy-example-1253

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 25, 2026

Summary

Fixes #1253.

The defer_destroy documentation reused an example from defer_unchecked that used Shared<i32>. Because i32 is Send, that example did not demonstrate why the API omits a T: Send bound.

This updates the example to use nested Shared<Shared<i32>> and clarifies that defer_destroy delegates to defer_unchecked.

Test plan

  • Documentation-only change

The previous example used `Shared<i32>`, which is Send because `i32`
is Send, so it did not illustrate why `defer_destroy` omits a `T: Send`
bound. Use a nested `Shared<Shared<i32>>` example instead and note that
the method delegates to `defer_unchecked`.

Fixes crossbeam-rs#1253

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

The documentation example about T: Send not being required for Guard::defer_destroy does not apply to the function

1 participant