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 18 pull requests #81578

Merged
merged 41 commits into from
Jan 31, 2021
Merged

Rollup of 18 pull requests #81578

merged 41 commits into from
Jan 31, 2021

Commits on Dec 15, 2020

  1. stabilise --include-ignored

    gilescope committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    fe2880a View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2020

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

Commits on Dec 21, 2020

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

Commits on Dec 29, 2020

  1. Stabilize by-value [T; N] iterator core::array::IntoIter

    Tracking issue: #65798
    
    This is unblocked now that `min_const_generics` has been stabilized
    in #79135.
    
    This PR does *not* include the corresponding `IntoIterator` impl,
    which is #65819.
    Instead, an iterator can be constructed through the `new` method.
    
    `new` would become unnecessary when `IntoIterator` is implemented
    and might be deprecated then, although it will stay stable.
    SimonSapin committed Dec 29, 2020
    Configuration menu
    Copy the full SHA
    61c49d4 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2021

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

Commits on Jan 15, 2021

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

Commits on Jan 19, 2021

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

Commits on Jan 21, 2021

  1. Add example to array::IntoIter::new’s doc-comment

    Co-authored-by: Ashley Mannix <[email protected]>
    SimonSapin and KodrAus authored Jan 21, 2021
    Configuration menu
    Copy the full SHA
    83d32b0 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

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

Commits on Jan 28, 2021

  1. Clone entire TokenCursor when collecting tokens

    Reverts PR #80830
    Fixes taiki-e/pin-project#312
    
    We can have an arbitrary number of `None`-delimited group frames pushed
    on the stack due to proc-macro invocations, which can legally be exited.
    Attempting to account for this would add a lot of complexity for a tiny
    performance gain, so let's just use the original strategy.
    Aaron1011 committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    5d73918 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ada714d View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2021

  1. Add a regression test

    0yoyoyo committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    81ed4cf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    56c2736 View commit details
    Browse the repository at this point in the history
  3. Balance sidebar Deref cycle check with main content

    The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
    that the main content code path checks for cycles _before_ descending, while the
    sidebar checks _after_. Checking _before_ is correct, so this changes the
    sidebar path to match the main content path.
    jryans committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    7e32178 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a2a5f0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    55d6247 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d3048ee View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6d7ef10 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    131ee07 View commit details
    Browse the repository at this point in the history
  9. Edit rustc_typeck top-level docs

    Edit punctuation and wording in note on type variables
    vs. type parameters.
    
    Also add missing punctuation and two inter-doc links.
    pierwill committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    adfb04f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    fe4ac95 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    bef4ec2 View commit details
    Browse the repository at this point in the history
  12. impl Seek for Empty

    Fix #78029
    oberien committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    f1cd179 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2021

  1. Rollup merge of #78044 - oberien:empty-seek, r=m-ou-se

    Implement io::Seek for io::Empty
    
    Fix #78029
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    1bf1305 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of #79285 - yoshuawuyts:stabilize-arc_mutate_strong_coun…

    …t, r=m-ou-se
    
    Stabilize Arc::{increment,decrement}_strong_count
    
    Tracking issue: #71983
    
    Stabilizes `Arc::{incr,decr}_strong_count`, enabling unsafely incrementing an decrementing the Arc strong count directly with fewer gotchas. This API was first introduced on nightly six months ago, and has not seen any changes since. The initial PR showed two existing pieces of code that would benefit from this API, and included a change inside the stdlib to use this.
    
    Given the small surface area, predictable use, and no changes since introduction, I'd like to propose we stabilize this.
    
    closes #71983
    r? `@Mark-Simulacrum`
    
    ## Links
     * [Initial implementation](#70733)
     * [Motivation from #68700](#68700 (comment))
     * [Real world example in an executor](https://docs.rs/extreme/666.666.666666/src/extreme/lib.rs.html#13)
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    ac37c32 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of #80053 - gilescope:include-ignore, r=m-ou-se

    stabilise `cargo test -- --include-ignored`
    
    stabilise `cargo test -- --include-ignored`
    
    On stable there's no way to run ignored tests as well as the normal tests.
    
    An example use case where stabilising this would help:
    Exercism has some initial tests and then some additional ignored tests that people run currently with --ignore but currently they can't run all the tests in one go without being on nightly. It would be a little more ergonomic if this flag was stablilised.
    
    ( Fixes  #65770 )
    
    I built with ./x.py build -i library/test - but as libtest is a dylib is there an easy way to invoke it manually to check it's working as expected? (I've updated the automated tests.)
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    b28a1b2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of #80279 - Yaulendil:str-as-mut, r=m-ou-se

    Implement missing `AsMut<str>` for `str`
    
    Allows `&mut str` to be taken by a Generic which requires `T` such that `T: AsMut<str>`. Motivating example:
    
    ```rust
    impl<'i, T> From<T> for StructImmut<'i> where
        T: AsRef<str> + 'i,
    {
        fn from(asref: T) -> Self {
            let string: &str = asref.as_ref();
            //  ...
        }
    }
    
    impl<'i, T> From<T> for StructMut<'i> where
        T: AsMut<str> + 'i,
    {
        fn from(mut asmut: T) -> Self {
            let string: &mut str = asmut.as_mut();
            //  ...
        }
    }
    ```
    
    The Immutable form of this structure can be constructed by `StructImmut::from(s)` where `s` may be a `&String` or a `&str`, because `AsRef<str>` is implemented for `str`. However, the mutable form of the structure can be constructed in the same way **only** with a `&mut String`, and **not** with a `&mut str`.
    
    This change does have some precedent, because as can be seen in [the Implementors](https://doc.rust-lang.org/std/convert/trait.AsMut.html#implementors), `AsMut<[T]>` is implemented for `[T]` as well as for `Vec<T>`, but `AsMut<str>` is implemented only for `String`. This would complete the symmetry.
    
    As a trait implementation, this should be immediately stable.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    054c29d View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-se

    Stabilize by-value `[T; N]` iterator `core::array::IntoIter`
    
    Tracking issue: #65798
    
    This is unblocked now that `min_const_generics` has been stabilized in #79135.
    
    This PR does *not* include the corresponding `IntoIterator` impl, which is #65819. Instead, an iterator can be constructed through the `new` method.
    
    `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    1e99f26 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #80945 - sdroege:downcast-send-sync, r=m-ou-se

    Add Box::downcast() for dyn Any + Send + Sync
    
    Looks like a plain omission, but unfortunately I just needed that in my code :)
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    caf2c06 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #81048 - yoshuawuyts:stabilize-core-slice-fill-with, …

    …r=m-ou-se
    
    Stabilize `core::slice::fill_with`
    
    _Tracking issue: https://github.com/rust-lang/rust/issues/79221_
    
    This stabilizes the `slice_fill_with` feature for Rust 1.51, following the stabilization of `slice_fill` in 1.50. This was requested by libs team members in #79213.
    
    This PR also adds the "memset" alias for `slice::fill_with`, mirroring the alias set on the `slice::fill` sibling API. This will ensure someone looking for "memset" will find both variants.
    
    r? `@Amanieu`
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    0793fab View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #81198 - dtolnay:partialeq, r=m-ou-se

    Remove requirement that forces symmetric and transitive PartialEq impls to exist
    
    ### Counterexample of symmetry:
    
    If you [have](https://docs.rs/proc-macro2/1.0.24/proc_macro2/struct.Ident.html#impl-PartialEq%3CT%3E) an impl like:
    
    ```rust
    impl<T> PartialEq<T> for Ident
    where
        T: ?Sized + AsRef<str>
    ```
    
    then Rust will not even allow the symmetric impl to exist.
    
    ```console
    error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Ident`)
     --> src/main.rs:9:6
      |
    9 | impl<T> PartialEq<Ident> for T where T: ?Sized + AsRef<str> {
      |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Ident`)
      |
      = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
      = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
    ```
    
    <br>
    
    ### Counterexample of transitivity:
    
    Consider these two existing impls from `regex` and `clap`:
    
    ```rust
    // regex
    
    /// An inline representation of `Option<char>`.
    pub struct Char(u32);
    
    impl PartialEq<char> for Char {
        fn eq(&self, other: &char) -> bool {
            self.0 == *other as u32
        }
    }
    ```
    
    ```rust
    // clap
    
    pub(crate) enum KeyType {
        Short(char),
        Long(OsString),
        Position(u64),
    }
    
    impl PartialEq<char> for KeyType {
        fn eq(&self, rhs: &char) -> bool {
            match self {
                KeyType::Short(c) => c == rhs,
                _ => false,
            }
        }
    }
    ```
    
    It's nice to be able to add `PartialEq<proc_macro::Punct> for char` in libproc_macro (#80595), but it makes no sense to force an `impl PartialEq<Punct> for Char` and `impl PartialEq<Punct> for KeyType` in `regex` and `clap` in code that otherwise has nothing to do with proc macros.
    
    <br>
    
    `@rust-lang/libs`
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    13b3294 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #81422 - estebank:dotdot_sugg, r=davidtwco

    Account for existing `_` field pattern when suggesting `..`
    
    Follow up to #80017.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    84b6f46 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petroch…

    …enkov
    
    Clone entire `TokenCursor` when collecting tokens
    
    Reverts PR #80830
    Fixes taiki-e/pin-project#312
    
    We can have an arbitrary number of `None`-delimited group frames pushed
    on the stack due to proc-macro invocations, which can legally be exited.
    Attempting to account for this would add a lot of complexity for a tiny
    performance gain, so let's just use the original strategy.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    3e8ae5d View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #81484 - Kogia-sima:perf/optimize-udiv_1e19, r=nagisa

    Optimize decimal formatting of 128-bit integers
    
    ## Description
    
    This PR optimizes the `udivmod_1e19` function, which is used for formatting 128-bit integers, based on the algorithm provided in \[1\]. This optimization improves performance of formatting 128-bit integers, especially on 64-bit architectures. It also slightly reduces the output binary size.
    
    ## Assembler comparison
    
    https://godbolt.org/z/YrG5zY
    
    ## Performance
    
    #### previous results
    
    ```
    test fmt::write_u128_max                                        ... bench:         552 ns/iter (+/- 4)
    test fmt::write_u128_min                                        ... bench:         125 ns/iter (+/- 2)
    ```
    
    #### new results
    
    ```
    test fmt::write_u128_max                                        ... bench:         205 ns/iter (+/- 13)
    test fmt::write_u128_min                                        ... bench:         129 ns/iter (+/- 5)
    ```
    
    ## Reference
    
    \[1\] T. Granlund and P. Montgomery, “Division by Invariant Integers Using Multiplication” in Proc. of the SIGPLAN94 Conference on Programming Language Design and Implementation, 1994, pp. 61–72
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    fd868d0 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeG…

    …omez
    
    Balance sidebar `Deref` cycle check with main content
    
    The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
    that the main content code path checks for cycles _before_ descending, while the
    sidebar checks _after_. Checking _before_ is correct, so this changes the
    sidebar path to match the main content path.
    
    Fixes #81395
    
    r? ```@GuillaumeGomez```
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    4de3181 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #81509 - 0yoyoyo:fix-issue-72685-ice-drop-in-place, r…

    …=estebank
    
    Add a regression test for ICE of bad_placeholder_type
    
    Add a regression test for #72685. Check the error message is output instead of ICE.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    c74f004 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #81547 - pierwill:edit-typeck-mod-docs, r=davidtwco

    Edit rustc_typeck top-level docs
    
    Edit punctuation and wording in note on type variables vs. type parameters.
    
    Also add missing punctuation and two inter-doc links.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    33cd862 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #81550 - xfix:replace-mention-of-predecessor, r=jonas…

    …-schievink
    
    Replace predecessor with range in collections documentation
    
    Fixes #81548.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    635dbd6 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    45d24c7 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of #81562 - the8472:improve-inplaceiterable-docs, r=sfac…

    …kler
    
    Clarify that InPlaceIterable guarantees extend to all advancing iterator methods.
    
    A documentation update that should answer a question that came up in [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Safety.20guarantees.20of.20InPlaceIterable/near/223743336)
    
    CC `@SkiFire13`
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    7097105 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    8b281d9 View commit details
    Browse the repository at this point in the history