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

A better Array::uninit and deprecate Array::uninitialized #902

Merged
merged 5 commits into from
Jan 30, 2021

Commits on Jan 30, 2021

  1. FEAT: Rename maybe_uninit to Array::uninit and move to base type

    Old type situation: `Array<MaybeUninit<i32>, D>::maybe_uninit()`
    
    New type situation: `Array<i32, D>::uninit()`
    
    The link between the regular array storage type and the maybeuninit
    version of it is made explicit in the DataOwned trait and this makes
    it much easier to work with this constructor in generic code.
    
    The new name is "uninit", just like many types in std (likej
    `Box::uninit`).
    
    The old name is deprecated. Because of the unfortunate generics
    situation of the old name, the implementation is a copy & paste (short
    allegory - inside ArrayBase::uninit we have types S and S::MaybeUninit
    "available" as known type, inside ArrayBase::maybe_uninit we only have a
    `DataOwned<Elem = MaybeUninit<_>>` type "avaialable" and no way to find the
    corresponding "plain" storage type.)
    bluss committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    b9c12b0 View commit details
    Browse the repository at this point in the history
  2. FEAT: Add constructor method build_uninit

    This method allows creating any owned array and initializing it - the
    method helps by giving mutable access even to normally copy-on-write
    arrays, because when first created, the array is unshared.
    bluss committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    00a8d48 View commit details
    Browse the repository at this point in the history
  3. FEAT: Add internal map_collect method that collects to any array storage

    This generalizes .map_collect() so that it supports any DataOwned array
    storage. It is a crate internal method initially - it can be exported
    later with more experience.
    bluss committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    82150cb View commit details
    Browse the repository at this point in the history
  4. API: Deprecate Array::uninitialized. Use Array::uninit instead

    Array::uninitialized is very hard to use correctly (internally and for
    our users). Prefer the new API with Array::uninit using `MaybeUninit<_>`
    instead.
    bluss committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    fdb9618 View commit details
    Browse the repository at this point in the history
  5. MAINT: Increase MSRV to 1.49

    1.49 had a lot of fixes to associated types and bounds, and that enables
    the new DataOwned changes to compile.
    bluss committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    802aa54 View commit details
    Browse the repository at this point in the history