-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 9 pull requests #120226
Conversation
- lint if the lock was in a nested pattern - lint if the lock is inside a `Result<Lock, _>`
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.
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.
…_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.
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)
…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.
…odals, r=fmease rustdoc: hide modals when resizing the sidebar Follow-up for rust-lang#119477 (comment) CC `@lukas-code`
…compiler-errors,oli-obk Fix error counting There is some messiness in how errors get counted. Here are some cleanups. r? `@compiler-errors`
…-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.
…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)
…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.
…r=compiler-errors Give nnethercote more reviews Gulp!
@bors r+ rollup=never p=9 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 6fff796eac In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (366d112): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 662.296s -> 663.975s (0.25%) |
Successful merges:
(Partial)Ord
on enums #118714 ( Explanation that fields are being used when deriving(Partial)Ord
on enums)let_underscore_lock
#119710 (Improvelet_underscore_lock
)#[must_use]
Diagnostic Message forOption::is_none
#120194 (Shorten#[must_use]
Diagnostic Message forOption::is_none
)#!/bin/bash
with#!/usr/bin/env bash
in rust-installer tests #120203 (Replace#!/bin/bash
with#!/usr/bin/env bash
in rust-installer tests)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup