google / google/zerocopy

Support tracking initialized-ness of `MaybeUninit`s in control flow graph

Open
#1,878 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.6k
Forks
179
Avg merge
1d 19h
Merged PRs (30d)
29

Description

This would allow writing code that operates on a scratch space of one or more `MaybeUninit`s without requiring the user to unsafely call `assume_init` or perform an unsafe read from a `MaybeUninit`.

A common pattern is to loop over an array of `MaybeUninit`s, initializing each value along the way and sometimes reading earlier values.

Prior art: [`bytes::UninitSlice`](https://docs.rs/bytes/1.7.2/bytes/buf/struct.UninitSlice.html)

cc @maurer

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.