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 9 pull requests #82393

Merged
merged 34 commits into from
Feb 22, 2021
Merged

Rollup of 9 pull requests #82393

merged 34 commits into from
Feb 22, 2021

Commits on Feb 15, 2021

  1. Add internal collect_into_array[_unchecked] to remove duplicate code

    This does not suggest adding such a function to the public API. This is
    just for the purpose of avoiding duplicate code. Many array methods
    already contained the same kind of code and there are still many array
    related methods to come (e.g. `Iterator::{chunks, map_windows, next_n,
    ...}`) which all basically need this functionality. Writing custom
    `unsafe` code for each of those seems not like a good idea.
    LukasKalbertodt committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    c675af8 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2021

  1. std::src::os::raw: Refactor, introducing macro type_alias!

    This file contained a lot of repetitive code.  This was about to get
    considerably worse, with introduction of a slew of new aliases.
    
    No functional change.  I've eyeballed the docs and they don't seem to
    have changed either.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    d6b9d9a View commit details
    Browse the repository at this point in the history
  2. Provide NonZero_c_* integers

    I'm pretty sure I am going want this for rust-lang#73125 and it seems like an
    omission that would be in any case good to remedy.
    
    It's a shame we don't have competent token pasting and case mangling
    for use in macro_rules!.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    e78b501 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2021

  1. Configuration menu
    Copy the full SHA
    447ce27 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5538528 View commit details
    Browse the repository at this point in the history
  3. Cut off plain text descriptions after headers

    Before:
    
        The Rust Standard LibraryThe Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the broader Rust ecosystem. It offers core types, like `Vec<T>` and `Option<T>`, library-defined operations on language primitives, standard macros, I/O and multithreading, among many other things.
    
    After:
    
        The Rust Standard Library
    notriddle committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    1bedd4d View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2021

  1. Revert changes to all.html

    This code wasn't actually working, and trying to SEO optimize that page is pointless anyway.
    notriddle committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    bcef5e7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8b3b1c9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dcf4991 View commit details
    Browse the repository at this point in the history
  4. Use has for non-regexes

    notriddle committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    fd5a710 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6a85719 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    60a9dcc View commit details
    Browse the repository at this point in the history
  7. remove unneccessary wrapping of return value of allow_unstable(), it …

    …would always return Some(thing)
    matthiaskrgr committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    4cb649b View commit details
    Browse the repository at this point in the history
  8. rustc_parse: remove unneccessary wrapping of return value in fn mk_ra…

    …nge() which would always return Ok(..)
    matthiaskrgr committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    12080dc View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    00bc134 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    85bd00f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    393878b View commit details
    Browse the repository at this point in the history
  12. rustc_codegen_ssa: remove unneeded wrapping of return type of execute…

    …_copy_from_cache_work_item (always returns Ok(..))
    matthiaskrgr committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    76b9b16 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a9b90c0 View commit details
    Browse the repository at this point in the history
  14. improve UnsafeCell docs

    RalfJung committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    1260883 View commit details
    Browse the repository at this point in the history
  15. Update src/test/rustdoc/description.rs

    Co-authored-by: Joshua Nelson <joshua@yottadb.com>
    notriddle and Joshua Nelson authored Feb 21, 2021
    Configuration menu
    Copy the full SHA
    a6b85fb View commit details
    Browse the repository at this point in the history
  16. Update src/test/rustdoc/description.rs

    Co-authored-by: Joshua Nelson <joshua@yottadb.com>
    notriddle and Joshua Nelson authored Feb 21, 2021
    Configuration menu
    Copy the full SHA
    575c75b View commit details
    Browse the repository at this point in the history
  17. remove redundant wrapping of return types of allow_internal_unstable(…

    …) and rustc_allow_const_fn_unstable()
    matthiaskrgr committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    da9a588 View commit details
    Browse the repository at this point in the history
  18. Fix sizes of repr(C) enums on hexagon

    Enums on hexagon use a smallest size (but at least 1 byte) that fits all
    the enumeration values. This is unlike many other ABIs where enums are
    at least 32 bits.
    nagisa committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    7130e46 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2021

  1. Configuration menu
    Copy the full SHA
    45673e2 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#82098 - LukasKalbertodt:add-collect-into-ar…

    …ray, r=dtolnay
    
    Add internal `collect_into_array[_unchecked]` to remove duplicate code
    
    Unlike the similar PRs  rust-lang#69985, rust-lang#75644 and rust-lang#79659, this PR only adds private functions and does not propose any new public API. The change is just for the purpose of avoiding duplicate code.
    
    Many array methods already contained the same kind of code and there are still many array related methods to come (e.g. `Iterator::{chunks, map_windows, next_n, ...}`, `[T; N]::{cloned, copied, ...}`, ...) which all basically need this functionality. Writing custom `unsafe` code for each of those doesn't seem like a good idea. I added two functions in this PR (and not just the `unsafe` version) because I already know that I need the `Option`-returning version for `Iterator::map_windows`.
    
    This is closely related to rust-lang#81615. I think that all options listed in that issue can be implemented using the function added in this PR. The only instance where `collect_array_into` might not be general enough is when the caller want to handle incomplete arrays manually. Currently, if `iter` yields fewer than `N` items, `None` is returned and the already yielded items are dropped. But as this is just a private function, it can be made more general in future PRs.
    
    And while this was not the goal, this seems to lead to better assembly for `array::map`: https://rust.godbolt.org/z/75qKTa (CC ``@JulianKnodt)``
    
    Let me know what you think :)
    
    CC ``@matklad`` ``@bstrie``
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    3cf201f View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#82228 - ijackson:nonzero-cint, r=KodrAus

    Provide NonZero_c_* integers
    
    I'm pretty sure I am going want this for rust-lang#73125 and it seems like an
    omission that would be in any case good to remedy.
    
    <strike>Because the raw C types are in `std`, not `core`, to achieve this we
    must export the relevant macros from `core` so that `std` can use
    them.  That's done with a new `num_internals` perma-unstable feature.
    
    The macros need to take more parameters for the module to get the
    types from and feature attributes to use.
    
    I have eyeballed the docs output for core, to check that my changes to
    these macros have made no difference to the core docs output.</strike>
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    a5f6668 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#82287 - r00ster91:field_name_and, r=petroch…

    …enkov
    
    Make "missing field" error message more natural
    
    ```rust
    struct A {
        x: i32,
        y: i32,
        z: i32,
    }
    
    fn main() {
        A { };
    }
    ```
    ```
    error[E0063]: missing fields `x`, `y`, `z` in initializer of `A`
     --> src/main.rs:8:5
      |
    8 |     A { };
      |     ^ missing `x`, `y`, `z`
    ```
    This error is now:
    ```
    error[E0063]: missing fields `x`, `y` and `z` in initializer of `A`
     --> src/main.rs:8:5
      |
    8 |     A { };
      |     ^ missing `x`, `y` and `z`
    ```
    I thought it looked nicer and more natural this way. Also, if there is >3 fields missing, there is an "and" as well ("missing \`x\`, \`y\`, \`z\` *and* 1 other field"), but for <=3 there is not. As such it improves consistency too.
    
    As for the implementation, originally I ended up with a chunky `push_str` algorithm but then I figured I could just do the formatting manually since it's just 3 field names at maximum. It is comparatively readable.
    
    As a sidenote, one thing I was wondering about is, isn't there more cases where you have a list of things like field names? Maybe this whole thing can at some point later be made into a more general function to be used in multiple areas.
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    20c1fa1 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#82351 - notriddle:docs-meta-description, r=…

    …jyn514
    
    Use the first paragraph, instead of cookie-cutter text, for rustdoc descriptions
    
    Partially addresses rust-lang#82283.
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    1dba8ce View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#82353 - camelid:no-more-param_env-cell, r=j…

    …yn514
    
    rustdoc: Remove unnecessary `Cell` around `param_env`
    
    r? `@jyn514`
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    4dfe69a View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#82367 - matthiaskrgr:wraps, r=petrochenkov

    remove redundant option/result wrapping of return values
    
    If a function always returns `Ok(something)`, we can return `something` directly and remove the corresponding error handling in the callers.
    clippy::unnecessary_wraps
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    1870b3b View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#82372 - RalfJung:unsafe-cell, r=KodrAus

    improve UnsafeCell docs
    
    Sometimes [questions like this come up](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/UnsafeCells.20as.20raw.20pointers) because the UnsafeCell docs say "it's the only legal way to obtain aliasable data that is considered mutable". That is not entirely correct, since raw pointers also provide that option. So I propose we focus the docs on the interaction of `UnsafeCell` and *shared references* specifically, which is really where they are needed.
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    7958166 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#82379 - nagisa:nagisa/hexagon-enums, r=este…

    …bank
    
    Fix sizes of repr(C) enums on hexagon
    
    Enums on hexagon use a smallest size (but at least 1 byte) that fits all
    the enumeration values. This is unlike many other ABIs where enums are
    at least 32 bits.
    
    Fixes rust-lang#82100
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    50a2de2 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#82382 - camelid:remove-fake_def_ids-refcell…

    …, r=jyn514
    
    rustdoc: Remove `fake_def_ids` RefCell
    JohnTitor authored Feb 22, 2021
    Configuration menu
    Copy the full SHA
    86940be View commit details
    Browse the repository at this point in the history