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

Merged
merged 25 commits into from
Jan 22, 2024
Merged

Rollup of 9 pull requests #120226

merged 25 commits into from
Jan 22, 2024

Commits on Dec 7, 2023

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

Commits on Jan 8, 2024

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

Commits on Jan 12, 2024

  1. Improve let_underscore_lock

    - lint if the lock was in a nested pattern
    - lint if the lock is inside a `Result<Lock, _>`
    Noratrieb committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    a04ac49 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2024

  1. Configuration menu
    Copy the full SHA
    724fe8f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6b8eae0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    76659ae View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2024

  1. chore: suggest wrapping in an assert!() instead

    This shortens the `#[must_use]` diagnostics displayed, in light of the [review comment](https://github.com/rust-lang/rust/pull/62431/files#r300819839) on when this was originally added.
    HTGAzureX1212 committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    1821bfa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ff02662 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    30b8b44 View commit details
    Browse the repository at this point in the history
  4. Adjust whitespace.

    nnethercote committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    ab6216a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ae3c00c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b95ce30 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f00c088 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    807c868 View commit details
    Browse the repository at this point in the history
  9. Tweak error counting.

    We have several methods indicating the presence of errors, lint errors,
    and delayed bugs. I find it frustrating that it's very unclear which one
    you should use in any particular spot. This commit attempts to instill a
    basic principle of "use the least general one possible", because that
    reflects reality in practice -- `has_errors` is the least general one
    and has by far the most uses (esp. via `abort_if_errors`).
    
    Specifics:
    - Add some comments giving some usage guidelines.
    - Prefer `has_errors` to comparing `err_count` to zero.
    - Remove `has_errors_or_span_delayed_bugs` because it's a weird one: in
      the cases where we need to count delayed bugs, we should really be
      counting lint errors as well.
    - Rename `is_compilation_going_to_fail` as
      `has_errors_or_lint_errors_or_span_delayed_bugs`, for consistency with
      `has_errors` and `has_errors_or_lint_errors`.
    - Change a few other `has_errors_or_lint_errors` calls to `has_errors`,
      as per the "least general" principle.
    
    This didn't turn out to be as neat as I hoped when I started, but I
    think it's still an improvement.
    nnethercote committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    1f9fa23 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2024

  1. Configuration menu
    Copy the full SHA
    774a47d View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#118714 - The-Ludwig:explain_ord_derive_enum…

    …_field, r=Nilstrieb
    
     Explanation that fields are being used when deriving `(Partial)Ord` on enums
    
    When deriving `std::cmp::Ord` or `std::cmp::PartialOrd` on enums, their fields are compared if the variants are equal.
    This means that the last assertion in the following snipped panics.
    ```rust
    use std::cmp::{PartialEq, Eq, PartialOrd, Ord};
    
    #[derive(PartialEq, Eq, PartialOrd, Ord)]
    enum Sizes {
        Small(usize),
        Big(usize),
    }
    
    fn main() {
        let a = Sizes::Big(3);
        let b = Sizes::Big(5);
        let c = Sizes::Small(10);
        assert!( c < a);
        assert_eq!(a, c);
    }
    ```
    
    This is more often expected behavior than not, and can be easily circumvented, as discussed in [this thread](https://users.rust-lang.org/t/how-to-sort-enum-variants/52291/4).
    But it is addressed nowhere in the documentation, yet.
    So I stumbled across this, as I personally did not expect fields being used in `PartialOrd`.
    I added the explanation to the documentation.
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    6f7222c View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#119710 - Nilstrieb:let-_-=-oops, r=TaKO8Ki

    Improve `let_underscore_lock`
    
    - lint if the lock was in a nested pattern
    - lint if the lock is inside a `Result<Lock, _>`
    
    addresses rust-lang#119704 (comment)
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    72dddea View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#119726 - NCGThompson:div-overflow-doc, r=Ni…

    …lstrieb
    
    Tweak Library Integer Division Docs
    
    Improved the documentation and diagnostics related to panicking in the division-like methods in std:
    
    * For signed methods that can overflow, clarified "results in overflow" to "self is -1 and rhs is Self::MIN." This is more concise than saying "results in overflow" and then explaining how it could overflow.
    * For floor/ceil_div, corrected the documentation and made it more like the documentation in other methods.
    * For signed methods that can overflow, explicitly mention that they are not affected by compiler flags.
    * Removed all unused rustc_inherit_overflow_checks attributes. The non-division-like operations will never overflow.
    * Added track_caller attributes to all methods that can panic. The panic messages will always be correct. For example, division methods all have / before %.
    * Edited the saturating_div documentation to be consistent with similar methods.
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    7d7c225 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#119746 - notriddle:notriddle/resize-close-m…

    …odals, r=fmease
    
    rustdoc: hide modals when resizing the sidebar
    
    Follow-up for
    rust-lang#119477 (comment)
    
    CC `@lukas-code`
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    6687e8e View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#119986 - nnethercote:fix-error-counting, r=…

    …compiler-errors,oli-obk
    
    Fix error counting
    
    There is some messiness in how errors get counted. Here are some cleanups.
    
    r? `@compiler-errors`
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    bef2e85 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#120194 - HTGAzureX1212:HTGAzureX1212shorten…

    …-option-must-use, r=Nilstrieb
    
    Shorten `#[must_use]` Diagnostic Message for `Option::is_none`
    
    This shortens the `#[must_use]` diagnostics displayed, in light of the [review comment](https://github.com/rust-lang/rust/pull/62431/files#r300819839) on when this was originally added.
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    1df60b2 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#120200 - noritada:fix/broken-error-message-…

    …link, r=dtolnay
    
    Correct the anchor of an URL in an error message
    
    Following error message from rustc points to a URL, but its anchor does not exist.
    The destination seems to be https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib.
    This PR makes that correction.
    
          = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    50d0f24 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#120203 - rowan-sl:usr-bin-env-bash, r=compi…

    …ler-errors
    
    Replace `#!/bin/bash` with `#!/usr/bin/env bash` in rust-installer tests
    
    This allows the rust-installer tests to pass on NixOS
    
    This change has [already been made](rust-lang@302ad21) for the actual installer, it appears that the tests were just forgotten.
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    e39608d View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#120212 - nnethercote:nnethercote-reviewer, …

    …r=compiler-errors
    
    Give nnethercote more reviews
    
    Gulp!
    matthiaskrgr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    610f13d View commit details
    Browse the repository at this point in the history