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 8 pull requests #110967

Merged
merged 25 commits into from
Apr 29, 2023
Merged

Rollup of 8 pull requests #110967

merged 25 commits into from
Apr 29, 2023

Commits on Apr 27, 2023

  1. Configuration menu
    Copy the full SHA
    3d80dd9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    015acc2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3125979 View commit details
    Browse the repository at this point in the history
  4. only error with +whole-archive,+bundle for rlibs

    Fixes rust-lang#110912
    
    Checking `flavor == RlibFlavor::Normal` was accidentally lost in
    601fc8b
    rust-lang#105601
    
    That caused combining +whole-archive and +bundle link modifiers on
    non-rlib crates to fail with a confusing error message saying that
    combination is unstable for rlibs. In particular, this caused the
    build to fail when +whole-archive was used on staticlib crates, even
    though +whole-archive effectively does nothing on non-bin crates because
    the final linker invocation is left to an external build system.
    Be-ing committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    6a89e94 View commit details
    Browse the repository at this point in the history
  5. Remove MemDecoder::read_raw_bytes_inherent.

    It's unnecessary. Note that `MemDecoder::read_raw_bytes` how has a `&'a
    [u8]` return type, the same as what `read_raw_bytes_inherent` had.
    nnethercote committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    b51deba View commit details
    Browse the repository at this point in the history
  6. Add a comment explaining the lack of Decoder::read_enum_variant.

    Because I was wondering about it, and this may save a future person from
    also wondering.
    nnethercote committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    37c9e45 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2023

  1. Use NonNull::new_unchecked and NonNull::len in

    `rustc_arena`.
    JohnBobbo96 committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    618841b View commit details
    Browse the repository at this point in the history
  2. Remove a low-value assertion.

    Checking that `read_raw_bytes(len)` changes the position by `len` is a
    reasonable thing for a test, but isn't much use in just one of the
    zillion `Decodable` impls.
    nnethercote committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    fa133f5 View commit details
    Browse the repository at this point in the history
  3. Add some provided methods to Encoder/Decoder.

    The methods for `i8`, `bool`, `char`, `str` are the same for all impls,
    because they layered on top of other methods.
    nnethercote committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    7a16d25 View commit details
    Browse the repository at this point in the history
  4. Remove MemDecoder::read_byte.

    It's just a synonym for `read_u8`.
    nnethercote committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    a676dfa View commit details
    Browse the repository at this point in the history
  5. Remove some unnecessary derives.

    I was curious about how many `Encodable`/`Decodable` derives we have.
    Some grepping revealed that it's over 500 of each, but the number of
    `Encodable` ones was higher, which was weird. Most of the
    `Encodable`-only ones were in `hir.rs`. This commit removes them all,
    plus some other unnecessary derives in that file and others that I found
    via trial and error.
    nnethercote committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    23e91d4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    586d17d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f1b88ea View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b29b56f View commit details
    Browse the repository at this point in the history
  9. fix false negative for unused_mut

    Lukas Markeffsky committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    69c71da View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    754a62c View commit details
    Browse the repository at this point in the history
  11. remove unused muts

    Lukas Markeffsky committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    fc63926 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#110877 - compiler-errors:binop-err, r=cjgillot

    Provide better type hints when a type doesn't support a binary operator
    
    For example, when checking whether `vec![A] == vec![A]` holds, we first evaluate the LHS's ty, then probe for any `PartialEq` implementations for that. If none is found, we report an error by evaluating `Vec<A>: PartialEq<?0>` for fulfillment errors, but the RHS is not yet evaluated and remains an inference variable `?0`!
    
    To fix this, we evaluate the RHS and equate it to that RHS infer var `?0`, so that we are able to provide more detailed fulfillment errors for why `Vec<A>: PartialEq<Vec<A>>` doesn't hold (namely, the nested obligation `A: PartialEq<A>` doesn't hold).
    
    Fixes rust-lang#95285
    Fixes rust-lang#110867
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    aba9fb4 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#110917 - Be-ing:whole_archive_with_staticli…

    …b_fix, r=petrochenkov
    
    only error combining +whole-archive and +bundle for rlibs
    
    Fixes rust-lang#110912
    
    Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b
    rust-lang#105601
    
    That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system.
    
    cc ``@petrochenkov``
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    33f15e8 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#110921 - JohnBobbo96:rustc_arena_nonnull, r…

    …=Nilstrieb
    
    Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`.
    
    This avoids a few extra dereferences as well as an `unwrap`.
    
    According to the docs for [`NonNull::len`](https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.len) this also ensures that:
    
    > This function is safe, even when the non-null raw slice cannot be dereferenced to a slice because the pointer does not have a valid address.
    
    I am also fairly sure that the `unwrap` is unneeded in this case, as the docs for [`Box::into_raw`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.into_raw) also state:
    
    > Consumes the Box, returning a wrapped raw pointer.
    **The pointer will be properly aligned and non-null.**
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    4751c85 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#110927 - nnethercote:Encoder-Decoder-cleanu…

    …ps, r=scottmcm
    
    Encoder/decoder cleanups
    
    Best reviewed one commit at a time.
    
    r? ``@scottmcm``
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    37076eb View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#110944 - RalfJung:offset, r=compiler-errors

    share BinOp::Offset between CTFE and Miri
    
    r? ``@oli-obk``
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    03da9db View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#110948 - TimNN:patch-1, r=WaffleLapkin

    run-make test: using single quotes to not trigger the shell
    
    This test got added in rust-lang#110801.
    
    I'm no expert on Makefiles, but IIUC this command is passed to the shell, which usually tries to execute commands specified in between backticks in double-quoted strings.
    
    Using single quotes should fix this, I think. (Note: Waiting for CI to test this, since I only have a web browser available right now).
    
    r? ``@jyn514``
    
    cc ``@WaffleLapkin``
    
    Since this is breaking our build bot, even if it is not directly LLVM related: ``@rustbot`` label: +llvm-main
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    afbb188 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#110957 - WaffleLapkin:reach_generator_confl…

    …ict_error, r=cjgillot
    
    Fix an ICE in conflict error diagnostics
    
    Fixes  rust-lang#110929
    r? ``@cjgillot``
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    235d088 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#110960 - lukas-code:unused-mut, r=compiler-…

    …errors
    
    fix false negative for `unused_mut`
    
    fixes rust-lang#110849
    
    We want to avoid double diagnostics for code like this, but only if an error actually occurs:
    ```rust
    fn main() {
        let mut x: (i32, i32);
        x.0 = 1;
    }
    ```
    
    The first commit fixes the lint and the second one removes all the unused `mut`s it found.
    matthiaskrgr authored Apr 28, 2023
    Configuration menu
    Copy the full SHA
    34ef13b View commit details
    Browse the repository at this point in the history