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 #81761

Merged
merged 25 commits into from
Feb 5, 2021
Merged

Rollup of 9 pull requests #81761

merged 25 commits into from
Feb 5, 2021

Commits on Feb 2, 2021

  1. introduce future-compatibility warning for forbidden lint groups

    We used to ignore `forbid(group)` scenarios completely. This changed
    in rust-lang#78864, but that led to a number of regressions (rust-lang#80988, rust-lang#81218).
    
    This PR introduces a future compatibility warning for the case where
    a group is forbidden but then an individual lint within that group
    is allowed. We now issue a FCW when we see the "allow", but permit
    it to take effect.
    nikomatsakis committed Feb 2, 2021
    Configuration menu
    Copy the full SHA
    b6b897b View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2021

  1. OsStr eq_ignore_ascii_case takes arg by value

    Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference.
    
    This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`.
    
    Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example.
    
    If this change should be made in some other PR (like rust-lang#80193) then please just close this.
    TyPR124 authored Feb 3, 2021
    Configuration menu
    Copy the full SHA
    4d1efb7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d3d0fb7 View commit details
    Browse the repository at this point in the history
  3. Stabilize the Wake trait

    Co-Authored-By: Ashley Mannix <kodraus@hey.com>
    yoshuawuyts and KodrAus committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    2c8bf1d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3719247 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8988238 View commit details
    Browse the repository at this point in the history
  6. Add lint for panic!(123) which is not accepted in Rust 2021.

    This extends the `panic_fmt` lint to warn for all cases where the first
    argument cannot be interpreted as a format string, as will happen in
    Rust 2021.
    
    It suggests to add `"{}", ` to format the message as a string. In the
    case of `std::panic!()`, it also suggests the recently stabilized
    `std::panic::panic_any()` function as an alternative.
    
    It renames the lint to `non_fmt_panic` to match the lint naming
    guidelines.
    m-ou-se committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    a616f82 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    34d5ac2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e9ad5be View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    753b0b0 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3f3eb89 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0870c15 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2021

  1. Configuration menu
    Copy the full SHA
    5c056ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26af55f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    24e0940 View commit details
    Browse the repository at this point in the history
  4. Stabilize poison API of Once, rename poisoned()

    This stabilizes:
    
    * `OnceState`
    * `OnceState::is_poisoned()` (previously named `poisoned()`)
    * `Once::call_once_force()`
    
    `poisoned()` was renamed because the new name is more clear as a few
    people agreed and nobody objected.
    
    Closes rust-lang#33577
    Kixunil committed Feb 4, 2021
    Configuration menu
    Copy the full SHA
    f42e961 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#74304 - yoshuawuyts:stabilize-wake, r=KodrAus

    Stabilize the Wake trait
    
    This PR proposes stabilizing the `wake_trait` feature, tracking issue rust-lang#69912.
    
    ## Motivation
    
    The surface area this trait introduces is small, and it has been on nightly for 4 months without any reported issues. Given the surface area of this trait is small and only serves to provide a safe interface around the already stable [`std::task::RawWakerVTable`](https://doc.rust-lang.org/std/task/struct.RawWaker.html) it seems unlikely this trait will require any further changes. So I'm proposing we stabilize this.
    
    Personally I would love to have this available on stable, since it would enable cleaning up some runtime internals by removing the tedious pointer required to construct a [`RawWakerVTable`](https://doc.rust-lang.org/std/task/struct.RawWakerVTable.html). I believe the intent was always to introduce a `Wake` counterpart to `RawWaker` in order to safely construct `Waker` instances. And the `Wake` trait feels like it does that job as intended.
    
    ## Implementation notes
    
    This PR itself fixes a link in the docs, and introduces an example of how to use the trait: a minimal `block_on` example that runs a future to completion on the current thread. It doesn't include fancier features such as support for nesting, but is intended to serve as a teaching device for both `task::Wake` and futures alike.
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    d20d097 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#79805 - m-ou-se:iterator-reduce, r=KodrAus

    Rename Iterator::fold_first to reduce and stabilize it
    
    This stabilizes `#![feature(iterator_fold_self)]`.
    
    The name for this function (originally `fold_first`) was still an open question, but the discussion on [the tracking issue](rust-lang#68125) seems to have converged to `reduce`.
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    5b0acfd View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#81556 - nikomatsakis:forbidden-lint-groups-…

    …lint, r=pnkfelix
    
    introduce future-compatibility warning for forbidden lint groups
    
    We used to ignore `forbid(group)` scenarios completely. This changed in rust-lang#78864, but that led to a number of regressions (rust-lang#80988, rust-lang#81218).
    
    This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect.
    
    r? ``@Mark-Simulacrum``
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    c5990dd View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#81645 - m-ou-se:panic-lint, r=estebank,flip…

    …1995
    
    Add lint for `panic!(123)` which is not accepted in Rust 2021.
    
    This extends the `panic_fmt` lint to warn for all cases where the first argument cannot be interpreted as a format string, as will happen in Rust 2021.
    
    It suggests to add `"{}",` to format the message as a string. In the case of `std::panic!()`, it also suggests the recently stabilized
    `std::panic::panic_any()` function as an alternative.
    
    It renames the lint to `non_fmt_panic` to match the lint naming guidelines.
    
    ![image](https://user-images.githubusercontent.com/783247/106520928-675ea680-64d5-11eb-81f7-d8fa48b93a0b.png)
    
    This is part of rust-lang#80162.
    
    r? ```@estebank```
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    87b269a View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#81710 - TyPR124:patch-2, r=m-ou-se

    OsStr eq_ignore_ascii_case takes arg by value
    
    Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference.
    
    This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`.
    
    Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example.
    
    If this change should be made in some other PR (like rust-lang#80193) then please just close this.
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    21e5827 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#81711 - saethlin:ipaddr-inline, r=m-ou-se

    add #[inline] to all the public IpAddr functions
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    e0ddc05 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#81725 - mark-i-m:mv-test, r=Mark-Simulacrum

    Move test to be with the others
    
    No functional changes. I just created this test in the wrong place in a past PR. All of the other or-pattern tests are in the `or-patterns` directory.
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    83e0fe3 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#81727 - m-ou-se:unstabilize-bits, r=Mark-Si…

    …mulacrum
    
    Revert stabilizing integer::BITS.
    
    We agreed in the libs meeting just now to revert stablization, since the [breakage](rust-lang#81654) is significant throughout the ecosystem, through `lexical-core`.
    
    cc rust-lang#76904
    
    Fixes rust-lang#81654
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    113e27f View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#81745 - Kixunil:stabilize_once_poison, r=m-…

    …ou-se
    
    Stabilize poison API of Once, rename poisoned()
    
    This stabilizes:
    
    * `OnceState`
    * `OnceState::is_poisoned()` (previously named `poisoned()`)
    * `Once::call_once_force()`
    
    `poisoned()` was renamed because the new name is more clear as a few
    people agreed and nobody objected.
    
    Closes rust-lang#33577
    
    Notes:
    
    * I'm not entirely sure it's supposed to be 1.51, LMK if I did it wrong
    * I failed to run tests locally, so we will have to leave it to bors or someone else can try
    m-ou-se authored Feb 4, 2021
    Configuration menu
    Copy the full SHA
    6f014cd View commit details
    Browse the repository at this point in the history