rust/compiler/rustc_interface/src
Stuart Cook 7853b88423
Rollup merge of #138672 - Zoxc:deferred-queries-in-deadlock-handler, r=oli-obk
Avoiding calling queries when collecting active queries

This PR changes active query collection to no longer call queries. Instead the fields needing queries have their computation delayed to when an cycle error is emitted or when printing the query backtrace in a panic.

This is done by splitting the fields in `QueryStackFrame` needing queries into a new `QueryStackFrameExtra` type. When collecting queries `QueryStackFrame` will contain a closure that can create `QueryStackFrameExtra`, which does make use of queries. Calling `lift` on a `QueryStackFrame` or `CycleError` will convert it to a variant containing `QueryStackFrameExtra` using those closures.

This also only calls queries needed to collect information on a cycle errors, instead of information on all active queries.

Calling queries when collecting active queries is a bit odd. Calling queries should not be done in the deadlock handler at all.

This avoids the out of memory scenario in https://github.com/rust-lang/rust/issues/124901.
2025-03-27 15:57:22 +11:00
..
callbacks.rs Represent diagnostic side effects as dep nodes 2025-03-14 16:01:58 +01:00
errors.rs Move some calls to before calling codegen_crate 2025-03-21 13:23:07 +00:00
interface.rs Make opts.maybe_sysroot non-optional 2025-03-12 15:05:24 +00:00
lib.rs Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
limits.rs Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
passes.rs Add TyCtx::env_var_os 2025-03-26 15:46:05 +01:00
proc_macro_decls.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00
queries.rs Remove the parse query 2024-12-14 14:24:49 +00:00
tests.rs Make opts.maybe_sysroot non-optional 2025-03-12 15:05:24 +00:00
util.rs Avoiding calling queries when collecting active queries 2025-03-26 09:36:36 +01:00