Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tokio_util::io::read_exact_arc to safely read a new uninitialized Arc #7165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshtriplett
Copy link
Contributor

This encapsulates a common bit of unsafety.


Motivation

Inspired by having an otherwise completely safe crate in which this was the
only bit of unsafe code. Reading into an uninitialized Arc and then
initializing it requires the unsafe assume_init.

#7127

…ed `Arc`

This encapsulates a common bit of unsafety.
@joshtriplett
Copy link
Contributor Author

This will, presumably, need to wait for tokio's MSRV. :(

@maminrayej maminrayej added the A-tokio-util Area: The tokio-util crate label Feb 18, 2025
@Darksonn Darksonn added the M-io Module: tokio/io label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants