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 7 pull requests #103461

Closed
wants to merge 17 commits into from
Closed

Commits on Jul 21, 2022

  1. Remove redundant lifetime bound from impl Borrow for Cow

    The lifetime bound `B::Owned: 'a` is redundant and doesn't make a difference,
    because `Cow<'a, B>` comes with an implicit `B: 'a`, and associated types
    will outlive lifetimes outlived by the `Self` type (and all the trait's
    generic parameters, of which there are none in this case), so the implicit `B: 'a`
    implies `B::Owned: 'a` anyway.
    
    The explicit lifetime bound here does however end up in documentation,
    and that's confusing in my opinion, so let's remove it ^^
    steffahn committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    c03d10c View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2022

  1. rustc: Use unix_sigpipe instead of rustc_driver::set_sigpipe_handler

    This is the first (known) step towards starting to use `unix_sigpipe` in
    the wild. Eventually, `rustc_driver::set_sigpipe_handler` can be removed
    and all clients can use `unix_sigpipe` instead.
    
    For now we just start using `unix_sigpipe` in once place: `rustc`
    itself.
    
    It is easy to manually verify this change. If you remove
    `#[unix_sigpipe = "sig_dfl"]` and run `./x.py build` you will get an ICE
    when you do `./build/x86_64-unknown-linux-gnu/stage1/bin/rustc --help |
    false`. Add back `#[unix_sigpipe = "sig_dfl"]` and the ICE disappears
    again.
    Enselic committed Oct 2, 2022
    Configuration menu
    Copy the full SHA
    093b075 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2022

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

Commits on Oct 22, 2022

  1. Truncate thread names on Linux and Apple targets

    These targets have system limits on the thread names, 16 and 64 bytes
    respectively, and `pthread_setname_np` returns an error if the name is
    longer. However, we're not in a context that can propagate errors when
    we call this, and we used to implicitly truncate on Linux with `prctl`,
    so now we manually truncate these names ahead of time.
    cuviper committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    7280f3d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    12e4584 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    988e75b View commit details
    Browse the repository at this point in the history
  4. Bless tests

    fee1-dead committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    b614b0e View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2022

  1. Configuration menu
    Copy the full SHA
    4bd9844 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8b984e5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    15cfeb3 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2022

  1. Rollup merge of rust-lang#95710 - fee1-dead-contrib:stabilize_arbitra…

    …ry_enum_discriminant, r=joshtriplett
    
    Stabilize arbitrary_enum_discriminant, take 2
    
    Documentation has been updated in rust-lang/reference#1055. cc rust-lang#86860 for previous stabilization report.
    
    Not yet marks rust-lang#60553 as done: need documentation in the rust reference.
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    6317611 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#99578 - steffahn:remove_redundant_bound, r=…

    …thomcc
    
    Remove redundant lifetime bound from `impl Borrow for Cow`
    
    The lifetime bound `B::Owned: 'a` is redundant and doesn't make a difference,
    because `Cow<'a, B>` comes with an implicit `B: 'a`, and associated types
    will outlive lifetimes outlived by the `Self` type (and all the trait's
    generic parameters, of which there are none in this case), so the implicit `B: 'a`
    implies `B::Owned: 'a` anyway.
    
    The explicit lifetime bound here does however [end up in documentation](https://doc.rust-lang.org/std/borrow/enum.Cow.html#impl-Borrow%3CB%3E),
    and that's confusing in my opinion, so let's remove it ^^
    
    _(Documentation right now, compare to `AsRef`, too:)_
    ![Screenshot_20220722_014055](https://user-images.githubusercontent.com/3986214/180332665-424d0c05-afb3-40d8-a330-a57a2c9a494b.png)
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    0be42d5 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#100452 - ouz-a:issue-93242, r=jackh726

    Fake capture closures if typeck results are empty
    
    This ICE happens because `closure_min_captures` is empty, the reason it's empty is with the 2021 edition `enable_precise_capture` is set to true, which makes it so that we can't fake capture any information because that result of the `unwrap` is none hence the ICE.
    
    Other solution is editing [maybe_read_scrutinee](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/expr_use_visitor.rs.html#453-463) to this since empty slice contains no sub patterns.
    
    Fixes rust-lang#93242
    
    ```rust
    PatKind::Slice(_, ref slice, _) => {
        if slice.is_none(){
        need_to_be_read = true;
        }
    }
    // instead of
    PatKind::Or(_)
    | PatKind::Box(_)
    | PatKind::Slice(..)
    | PatKind::Ref(..)
    | PatKind::Wild => {}
    ```
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    97bf9d6 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#102587 - Enselic:rustc-unix_sigpipe, r=jack…

    …h726
    
    rustc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`
    
    This is the first (known) step towards starting to use `unix_sigpipe` in the wild. Eventually, `rustc_driver::set_sigpipe_handler` can be removed and all clients can use `unix_sigpipe` instead.
    
    For now we just start using `unix_sigpipe` in one place: `rustc` itself.
    
    It is easy to manually verify this change. If you remove `#[unix_sigpipe = "sig_dfl"]` and run `./x.py build` you will get an ICE when you do `./build/x86_64-unknown-linux-gnu/stage1/bin/rustc --help | false`. Add back `#[unix_sigpipe = "sig_dfl"]` and the ICE disappears again.
    
    PR that added `set_sigpipe_handler`: rust-lang#49606
    
    Tracking issue for `unix_sigpipe`: rust-lang#97889
    
    Not sure exactly how to label this PR. Going with T-libs for now since this is a T-libs feature.
    
    `@rustdoc` labels +T-libs
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    4a287d9 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#102766 - thomcc:remove-resolv, r=Mark-Simul…

    …acrum
    
    Don't link to `libresolv` in libstd on Darwin
    
    Currently we link `libresolv` into every Rust program on apple targets despite never using it (as of rust-lang#44965). I had thought we needed this for `getaddrinfo` or something, but we do not / cannot safely use it.
    
    I'd like to fix this for `libiconv` too (the other library we pull in. that's harder since it's coming in through `libc`, which is rust-lang/libc#2944)).
    
    ---
    
    This may warrant release notes. I'm not sure but I've added the flag regardless -- It's a change to the list of dylibs every Rust program pulls in, so it's worth mentioning.
    
    It's pretty unlikely anybody was relying on this being pulled in, and `std` does not guarantee that it will link (and thus transitively provide access to) any particular system library -- anybody relying on that behavior would already be broken when dynamically linking std. That is, there's an outside chance something will fail to link on macOS and iOS because it was accidentally relying on our unnecessary dependency.
    
    (If that *does* happen, that project could be easily fixed by linking libresolv explicitly on those platforms, probably via `#[link(name = "resolv")] extern {}`,` -Crustc-link-lib=resolv`, `println!("cargo:rustc-link-lib=resolv")`, or one of several places in `.config/cargo.toml`)
    
    ---
    
    I'm also going to preemptively add the nomination for discussing this in the libs meeting. Basically: Do we care about programs that assume we will bring libraries in that we do not use. `libresolv` and `libiconv` on macOS/iOS are in this camp (`libresolv` because we used to use it, and `libiconv` because the `libc` crate was unintentionally(?) pulling it in to every Rust program).
    
    I'd like to remove them both, but this may cause link issues programs that are relying on `std` to depend on them transitively. (Relying on std for this does not work in all build configurations, so this seems very fragile, and like a use case we should not support).
    
    More generally, IMO we should not guarantee the specific set of system-provided libraries we use (beyond what is implied by an OS version requirement), which means we'd be free to remove this cruft.
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    26a5833 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#103122 - ouz-a:mir-technical-debt, r=oli-obk

    Remove misc_cast and validate types when casting
    
    Continuing our work in rust-lang#102675
    
    r? `@oli-obk`
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    60f3f07 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#103379 - cuviper:truncate-thread-name, r=th…

    …omcc
    
    Truncate thread names on Linux and Apple targets
    
    These targets have system limits on the thread names, 16 and 64 bytes
    respectively, and `pthread_setname_np` returns an error if the name is
    longer. However, we're not in a context that can propagate errors when
    we call this, and we used to implicitly truncate on Linux with `prctl`,
    so now we manually truncate these names ahead of time.
    
    r? `@thomcc`
    Dylan-DPC authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    64e66e1 View commit details
    Browse the repository at this point in the history