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

[wip] UnalignUnsized #1828

Draft
wants to merge 2 commits into
base: maybe-uninit
Choose a base branch
from
Draft

[wip] UnalignUnsized #1828

wants to merge 2 commits into from

Commits on Nov 14, 2024

  1. Add initial support for unsized MaybeUninit wrapper type

    This is achieved by adding a `MaybeUninit` associated type to
    `KnownLayout`, whose layout is identical to `Self` except that it admits
    uninitialized bytes in all positions.
    
    For sized types, this is bound to `mem::MaybeUninit<Self>`. For
    potentially unsized structs, we synthesize a doppelganger with the same
    `repr`, whose leading fields are wrapped in `mem::MaybeUninit` and whose
    trailing field is the `MaybeUninit` associated type of struct's original
    trailing field type. This type-level recursion bottoms out at `[T]`,
    whose `MaybeUninit` associated type is bound to `[mem::MaybeUninit<T>]`.
    
    Makes progress towards #1797
    jswrenn committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    7da393c View commit details
    Browse the repository at this point in the history
  2. [wip] UnalignUnsized

    jswrenn committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    e8cc8eb View commit details
    Browse the repository at this point in the history