Skip to content

Conversation

@dvdhrm
Copy link
Member

@dvdhrm dvdhrm commented Jan 14, 2026

3 fixes to osi and a minor addition:

  • re-export core/alloc for macro use
  • add as_uninit() helper
  • fix as_bytes() to be unsafe, and document why

Export the core and alloc dependencies for macros to use. There is
little harm in re-exporting those dependencies, given that we already
depend on them, and on their stability guarantees.

This kinda blocks `osi::core` and `osi::alloc` for future use, but that
seems ok'ish, and would conflict with current use of `core` and `alloc`
inside of `osi`, anyway.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Two new helpers to get `MaybeUninit` for any read-only type. This is
really useful as source operand to `copy_from_slice()` and similar, if
the target is a `MaybeUninit`.

Signed-off-by: David Rheinsberg <david@readahead.eu>
Accessing uninitialized data is never safe in Rust. The reason is that
some hardware platforms have support for actual hardware markers of
uninitialized bytes, and thus LLVM can never provide a way to read such
data, even if the target platform would support it.

There is an argument to be made for Rust to use something else to model
padding bytes, but that is not our decision to make, so lets just not
read padding bytes for now.

Signed-off-by: David Rheinsberg <david@readahead.eu>
@dvdhrm dvdhrm merged commit 26784b3 into bus1:main Jan 14, 2026
10 checks passed
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