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 6 pull requests #96202

Closed
wants to merge 18 commits into from
Closed

Commits on Apr 15, 2022

  1. Remove --extern-location and all associated code

    `--extern-location` was an experiment to investigate the best way to
    generate useful diagnostics for unused dependency warnings by enabling a
    build system to identify the corresponding build config.
    
    While I did successfully use this, I've since been convinced the
    alternative `--json unused-externs` mechanism is the way to go, and
    there's no point in having two mechanisms with basically the same
    functionality.
    
    This effectively reverts rust-lang#72603
    jsgf committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    1be1157 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2022

  1. alloc: make vec! unavailable under no_global_oom_handling

    The `vec!` macro has 3 rules, but two are not usable under
    `no_global_oom_handling` builds of the standard library
    (even with a zero size):
    
    ```rust
    let _ = vec![42];    // Error: requires `exchange_malloc` lang_item.
    let _ = vec![42; 0]; // Error: cannot find function `from_elem`.
    ```
    
    Thus those two rules should not be available to begin with.
    
    The remaining one, with an empty matcher, is just a shorthand for
    `new()` and may not make as much sense to have alone, since the
    idea behind `vec!` is to enable `Vec`s to be defined with the same
    syntax as array expressions. Furthermore, the documentation can be
    confusing since it shows the other rules.
    
    Thus perhaps it is better and simpler to disable `vec!` entirely
    under `no_global_oom_handling` environments, and let users call
    `new()` instead:
    
    ```rust
    let _: Vec<i32> = vec![];
    let _: Vec<i32> = Vec::new();
    ```
    
    Notwithstanding this, a `try_vec!` macro would be useful, such as
    the one introduced in rust-lang#95051.
    
    If the shorthand for `new()` is deemed worth keeping on its own,
    then it may be interesting to have a separate `vec!` macro with
    a single rule and different, simpler documentation.
    
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Apr 16, 2022
    Configuration menu
    Copy the full SHA
    8cec88b View commit details
    Browse the repository at this point in the history
  2. Provide a better diagnostic on failure to meet send bound on futures …

    …in a foreign crate
    
    Adding diagnostic data on generators to the crate metadata and using it to provide
    a better diagnostic on failure to meet send bound on futures originated from a foreign crate
    oribenshir committed Apr 16, 2022
    Configuration menu
    Copy the full SHA
    ebe3c56 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2022

  1. Stop using CRATE_DEF_INDEX.

    `CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
    cjgillot committed Apr 17, 2022
    Configuration menu
    Copy the full SHA
    07ee031 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2022

  1. Define a dedicated error type for HandleOrNull and HandleOrInvalid.

    Define a `NotHandle` type, that implements `std::error::Error`, and use
    it as the error type in `HandleOrNull` and `HandleOrInvalid`.
    sunfishcode committed Apr 18, 2022
    Configuration menu
    Copy the full SHA
    703a336 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b3023c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    67994b7 View commit details
    Browse the repository at this point in the history
  4. Split NotHandle into NullHandleError and InvalidHandleError.

    Also, make the display messages more specific, and remove the `Copy`
    implementation.
    sunfishcode committed Apr 18, 2022
    Configuration menu
    Copy the full SHA
    f934043 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    890125d View commit details
    Browse the repository at this point in the history
  6. Update the expected stderr for coerce-issue-49593-box-never.

    This test's expected stderr now includes a count of the number of types
    that implment `Error`. This PR introduces two new types, so increment
    the number by two.
    sunfishcode committed Apr 18, 2022
    Configuration menu
    Copy the full SHA
    b7ff103 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2022

  1. Configuration menu
    Copy the full SHA
    19ef182 View commit details
    Browse the repository at this point in the history
  2. Improve AddrParseError description

    The existing description was incorrect for socket addresses, and
    misleading: users would see “invalid IP address syntax” and suppose they
    were supposed to provide an IP address rather than a socket address.
    
    I contemplated making it two variants (IP, socket), but realised we can
    do still better for the IPv4 and IPv6 types, so here it is as six.
    
    I contemplated more precise error descriptions (e.g. “invalid IPv6
    socket address syntax: expected a decimal scope ID after %”), but that’s
    a more invasive change, and probably not worthwhile anyway.
    chris-morgan committed Apr 19, 2022
    Configuration menu
    Copy the full SHA
    0255398 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#94493 - oribenshir:feature/ISSUE-78543_asyn…

    …c_fn_in_foreign_crate_diag_2, r=davidtwco
    
    Improved diagnostic on failure to meet send bound on future in a foreign crate
    
    Provide a better diagnostic on failure to meet send bound on futures in a foreign crate.
    
    fixes rust-lang#78543
    Dylan-DPC authored Apr 19, 2022
    Configuration menu
    Copy the full SHA
    a857380 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#96086 - jsgf:remove-extern-location, r=davi…

    …dtwco
    
    Remove `--extern-location` and all associated code
    
    `--extern-location` was an experiment to investigate the best way to
    generate useful diagnostics for unused dependency warnings by enabling a
    build system to identify the corresponding build config.
    
    While I did successfully use this, I've since been convinced the
    alternative `--json unused-externs` mechanism is the way to go, and
    there's no point in having two mechanisms with basically the same
    functionality.
    
    This effectively reverts rust-lang#72603
    Dylan-DPC authored Apr 19, 2022
    Configuration menu
    Copy the full SHA
    47ad09c View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#96089 - ojeda:no-vec-no_global_oom_handling…

    …, r=Mark-Simulacrum
    
    `alloc`: make `vec!` unavailable under `no_global_oom_handling`
    
    `alloc`: make `vec!` unavailable under `no_global_oom_handling`
    
    The `vec!` macro has 3 rules, but two are not usable under
    `no_global_oom_handling` builds of the standard library
    (even with a zero size):
    
    ```rust
    let _ = vec![42];    // Error: requires `exchange_malloc` lang_item.
    let _ = vec![42; 0]; // Error: cannot find function `from_elem`.
    ```
    
    Thus those two rules should not be available to begin with.
    
    The remaining one, with an empty matcher, is just a shorthand for
    `new()` and may not make as much sense to have alone, since the
    idea behind `vec!` is to enable `Vec`s to be defined with the same
    syntax as array expressions. Furthermore, the documentation can be
    confusing since it shows the other rules.
    
    Thus perhaps it is better and simpler to disable `vec!` entirely
    under `no_global_oom_handling` environments, and let users call
    `new()` instead:
    
    ```rust
    let _: Vec<i32> = vec![];
    let _: Vec<i32> = Vec::new();
    ```
    
    Notwithstanding this, a `try_vec!` macro would be useful, such as
    the one introduced in rust-lang#95051.
    
    If the shorthand for `new()` is deemed worth keeping on its own,
    then it may be interesting to have a separate `vec!` macro with
    a single rule and different, simpler documentation.
    
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    Dylan-DPC authored Apr 19, 2022
    Configuration menu
    Copy the full SHA
    58982f5 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#96142 - cjgillot:no-crate-def-index, r=petr…

    …ochenkov
    
    Stop using CRATE_DEF_INDEX outside of metadata encoding.
    
    `CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.  We should not manipulate raw `DefIndex` outside of metadata encoding.
    Dylan-DPC authored Apr 19, 2022
    Configuration menu
    Copy the full SHA
    23ed99b View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#96168 - chris-morgan:AddrParseError-descrip…

    …tion-improvements, r=joshtriplett
    
    Improve AddrParseError description
    
    The existing description was incorrect for socket addresses, and misleading: users would see “invalid IP address syntax” and suppose they were supposed to provide an IP address rather than a socket address.
    
    I contemplated making it two variants (IP, socket), but realised we can do still better for the IPv4 and IPv6 types, so here it is as six.
    
    I contemplated more precise error descriptions (e.g. “invalid IPv6 socket address syntax: expected a decimal scope ID after %”), but that’s a more invasive change, and probably not worthwhile anyway.
    Dylan-DPC authored Apr 19, 2022
    Configuration menu
    Copy the full SHA
    8417ba8 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#96195 - sunfishcode:sunfishcode/handle-or-e…

    …rror-type, r=joshtriplett
    
     Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`.
    
    Define `NullHandleError` and `InvalidHandleError` types, that implement std::error::Error, and use them as the error types in `HandleOrNull` and `HandleOrInvalid`,
    
    This addresses [this concern](rust-lang#87074 (comment)).
    
    This is the same as rust-lang#95387.
    
    r? `@joshtriplett`
    Dylan-DPC authored Apr 19, 2022
    Configuration menu
    Copy the full SHA
    c6114bb View commit details
    Browse the repository at this point in the history