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 array lang item and [T; N]::map(f: FnMut(T) -> S) #75212

Merged
merged 6 commits into from
Aug 13, 2020

Commits on Aug 13, 2020

  1. Create lang item array and add map fn

    This creates the language item for arrays, and adds the map fn which is like map in options or
    iterators. It currently allocates an extra array, unfortunately.
    
    Added fixme for transmuting
    
    Fix typo
    
    Add drop guard
    JulianKnodt committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    d871818 View commit details
    Browse the repository at this point in the history
  2. Add Array Impl Lang Item in various places

    Add basic test
    
    And also run fmt which is where the other changes are from
    
    Fix mut issues
    
    These only appear when running tests, so resolved by adding mut
    
    Swap order of forget
    
    Add pub and rm guard impl
    
    Add explicit type to guard
    
    Add safety note
    
    Change guard type from T to S
    
    It should never have been T, as it guards over [MaybeUninit<S>; N]
    Also add feature to test
    JulianKnodt committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    f6411e4 View commit details
    Browse the repository at this point in the history
  3. Add recommend changes to array

    Switch from indexing to zip, and also use `write` on `MaybeUninit`.
    
    Add array_map feature to core/src/lib
    
    Attempt to fix issue of no such feature
    
    Update w/ pickfire's review
    
    This changes a couple of names around, adds another small test of variable size,
    and hides the rustdoc #![feature(..)].
    
    Fmt doctest
    
    Add suggestions from lcnr
    JulianKnodt committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    56a651c View commit details
    Browse the repository at this point in the history
  4. Add tracking issue rust-lang#75243

    Add note & example about iter order
    
    Add doc changes
    
    Update doc comments
    JulianKnodt committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    54b821e View commit details
    Browse the repository at this point in the history
  5. Rm hiding feature gate & add 1 more example

    Update order docs for `map`
    JulianKnodt committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    412417d View commit details
    Browse the repository at this point in the history
  6. Add drop check test & MaybeUninit::first_ptr_mut

    Also in drop check test add hacky workaround for platforms that don't support
    panic=unwind
    JulianKnodt committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    af32db2 View commit details
    Browse the repository at this point in the history