Files
rust/compiler/rustc_query_impl/src
Jonathan Brouwer 53e67f248d Rollup merge of #153689 - nnethercote:rm-QueryLatchInfo, r=petrochenkov
Eliminate `QueryLatchInfo`.

The boolean `complete` flag indicates whether the `waiters` vec is still in use, which means the `waiters` vec must be empty when `complete` is true. This is achieved by using `drain` on the waiters just after `complete` is set.

We can do better by using the type system to make invalid combinations impossible. This commit removes `complete` and puts the waiters inside an `Option`. `Some` means the query job is still active, and `None` once it is complete. And `QueryLatchInfo` is eliminated.

(The `Arc<Mutex<Option<Vec<Arc<QueryWaiter<'tcx>>>>>>` type is a mouthful, but when it's all in one place I find it easier to understand than when it's split across two types. And we can use `Option` methods like `as_ref`, `as_mut`, and `take`, which is nice.)

r? @petrochenkov
2026-03-11 10:58:52 +01:00
..
2026-03-08 09:39:39 +11:00
2026-03-10 15:15:14 +03:00
2026-03-11 14:41:22 +11:00

For more information about how the query system works, see the rustc dev guide.