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

Rollup of 5 pull requests #95391

Closed
wants to merge 11 commits into from
Closed

Commits on Aug 26, 2021

  1. Configuration menu
    Copy the full SHA
    01b9fac View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2022

  1. Configuration menu
    Copy the full SHA
    ee23fd2 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2022

  1. Docs: make Vec::from_raw_parts documentation less strict

    This is my first PR; be gentle!
    
    In https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/2?u=janpaul123 it was suggested to me that I should make a PR to make the documentation of `Vec::from_raw_parts` less strict, since we don't require `T` to have the same size, just `size_of::<T>() * capacity` to be the same, since that is what results in `Layout::size` being the same in `dealloc`, which is really what matters.
    
    Also in https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/8?u=janpaul123 it was suggested that it's better to use `slice::from_raw_parts`, which I think is useful advise that could also be mentioned in the docs, so I added that too.
    
    Let me know what you think! :)
    janpaul123 authored Mar 16, 2022
    Configuration menu
    Copy the full SHA
    80340f6 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2022

  1. Configuration menu
    Copy the full SHA
    5dd7027 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2022

  1. Configuration menu
    Copy the full SHA
    38e0ae5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b51f20e View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2022

  1. Rollup merge of rust-lang#88375 - joshlf:patch-3, r=dtolnay

    Clarify that ManuallyDrop<T> has same layout as T
    
    This PR implements the documentation change under discussion in rust-lang/unsafe-code-guidelines#302. It should not be approved or merged until the discussion there is resolved.
    Dylan-DPC authored Mar 28, 2022
    Configuration menu
    Copy the full SHA
    7d6f510 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#93755 - ChayimFriedman2:allow-comparing-vec…

    …s-with-different-allocators, r=dtolnay
    
    Allow comparing `Vec`s with different allocators using `==`
    
    See https://stackoverflow.com/q/71021633/7884305.
    
    I did not changed the `PartialOrd` impl too because it was not generic already (didn't support `Vec<T> <=> Vec<U> where T: PartialOrd<U>`).
    
    Does it needs tests?
    
    I don't think this will hurt type inference much because the default allocator is usually not inferred (`new()` specifies it directly, and even with other allocators, you pass the allocator to `new_in()` so the compiler usually knows the type).
    
    I think this requires FCP since the impls are already stable.
    Dylan-DPC authored Mar 28, 2022
    Configuration menu
    Copy the full SHA
    63cb540 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#95016 - janpaul123:patch-1, r=dtolnay

    Docs: make Vec::from_raw_parts documentation less strict
    
    This is my first PR; be gentle!
    
    In https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/2?u=janpaul123 it was suggested to me that I should make a PR to make the documentation of `Vec::from_raw_parts` less strict, since we don't require `T` to have the same size, just `size_of::<T>() * capacity` to be the same, since that is what results in `Layout::size` being the same in `dealloc`, which is really what matters.
    
    Also in https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/8?u=janpaul123 it was suggested that it's better to use `slice::from_raw_parts`, which I think is useful advise that could also be mentioned in the docs, so I added that too.
    
    Let me know what you think! :)
    Dylan-DPC authored Mar 28, 2022
    Configuration menu
    Copy the full SHA
    7062db2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#95098 - shepmaster:vec-from-array-ref, r=dt…

    …olnay
    
    impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>
    
    I really wanted to write:
    
    ```rust
    fn example(a: impl Into<Vec<u8>>) {}
    
    fn main() {
        example(b"raw");
    }
    ```
    Dylan-DPC authored Mar 28, 2022
    Configuration menu
    Copy the full SHA
    031fd9b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    842ddf2 View commit details
    Browse the repository at this point in the history