rust/compiler/rustc_hir_analysis/src
Nicholas Nethercote 1f9fa2305a 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.
2024-01-22 10:14:01 +11:00
..
astconv Auto merge of #120100 - oli-obk:astconv_lifetimes, r=BoxyUwU 2024-01-21 00:33:43 +00:00
check Tweak error counting. 2024-01-22 10:14:01 +11:00
coherence Make crate_inherent_impls fallible and stop using track_errors for it 2024-01-17 10:02:29 +00:00
collect Rollup merge of #119869 - oli-obk:track_errors2, r=matthewjasper 2024-01-18 20:56:20 +01:00
impl_wf_check Rollup merge of #119869 - oli-obk:track_errors2, r=matthewjasper 2024-01-18 20:56:20 +01:00
outlives Stop using track_errors for some forever unstable rustc_attr analyses 2024-01-17 10:02:14 +00:00
structured_errors Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00
variance Stop using track_errors for some forever unstable rustc_attr analyses 2024-01-17 10:02:14 +00:00
autoderef.rs Remove special-casing around aliaskind in new solver 2024-01-11 16:54:11 +00:00
bounds.rs ~const trait or projection bounds do not imply non-const bounds 2024-01-08 15:01:14 +00:00
check_unused.rs Don't pass lint back out of lint decorator 2023-12-15 16:05:36 +00:00
collect.rs Don't forget that the lifetime on hir types is 'tcx 2024-01-18 16:07:10 +00:00
constrained_generic_params.rs finish RegionKind rename 2023-11-14 13:13:27 +00:00
errors.rs Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
hir_wf_check.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
impl_wf_check.rs Move check_mod_impl_wf query call out of track_errors and bubble errors up instead. 2024-01-17 10:02:19 +00:00
lib.rs Auto merge of #120100 - oli-obk:astconv_lifetimes, r=BoxyUwU 2024-01-21 00:33:43 +00:00
structured_errors.rs Rework how diagnostic lints are stored. 2024-01-14 14:04:25 +11:00