mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
68bff20d1d
Clarify how "ensure" queries check whether they can skip execution The current `check_cache: bool` field in QueryMode is confusing for a few reasons: - It actually refers to checking the *disk cache*, not the in-memory cache. - It gives no indication of what condition is being checked, or why. - It obscures the link between `tcx.ensure_ok()` and `tcx.ensure_done()`, and the actual check. This PR replaces that field with an `EnsureMode` enum that distinguishes between ensure-ok and ensure-done, and leaves the actual check as an implementation detail of the ensure-done mode. This PR also renames `ensure_must_run` → `check_if_ensure_can_skip_execution`, and uses a return struct to more clearly indicate how this helper function gives permission for its caller to skip execution of a query that would otherwise be executed. This also inverts the sense of the returned boolean, which was previously “must run” but is now ”skip execution”. r? nnethercote (or compiler)