-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix error counting #119986
Fix error counting #119986
Conversation
Looks good to me on a first pass, but given that this touches r? @oli-obk |
The other changes seem fine to me. I will be refactoring them in the future anyway, so cleaning up the API for them a bit just makes my job easier ^^ |
☔ The latest upstream changes (presumably #120112) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
29fa927
to
1f9fa23
Compare
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#118714 ( Explanation that fields are being used when deriving `(Partial)Ord` on enums) - rust-lang#119710 (Improve `let_underscore_lock`) - rust-lang#119726 (Tweak Library Integer Division Docs) - rust-lang#119746 (rustdoc: hide modals when resizing the sidebar) - rust-lang#119986 (Fix error counting) - rust-lang#120194 (Shorten `#[must_use]` Diagnostic Message for `Option::is_none`) - rust-lang#120200 (Correct the anchor of an URL in an error message) - rust-lang#120203 (Replace `#!/bin/bash` with `#!/usr/bin/env bash` in rust-installer tests) - rust-lang#120212 (Give nnethercote more reviews) r? `@ghost` `@rustbot` modify labels: rollup
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`
There is some messiness in how errors get counted. Here are some cleanups.
r? @compiler-errors