rust/compiler/rustc_interface
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
..
src Rollup merge of #138672 - Zoxc:deferred-queries-in-deadlock-handler, r=oli-obk 2025-03-27 15:57:22 +11:00
Cargo.toml Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
messages.ftl Move some calls to before calling codegen_crate 2025-03-21 13:23:07 +00:00