rust/compiler/rustc_middle/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
..
dep_graph Pass in dep kind names to the duplicate dep node check 2025-03-19 20:12:37 +01:00
hir Ensure define_opaque is accounted for in HIR hash 2025-03-26 00:15:34 +00:00
hooks Pretty print pattern type values with transmute if they don't satisfy their pattern 2025-02-05 14:56:41 +00:00
infer Clean up trivial traversal/lift impl generator macro calls. 2025-02-06 13:31:43 +11:00
middle Mark #[rustc_std_internal_symbol] as extern indicator 2025-03-17 14:06:56 +00:00
mir Auto merge of #136410 - saethlin:clean-up-cgu-internal-copy, r=compiler-errors 2025-03-25 06:36:41 +00:00
query Rollup merge of #138672 - Zoxc:deferred-queries-in-deadlock-handler, r=oli-obk 2025-03-27 15:57:22 +11:00
thir Extract for_each_immediate_subpat from THIR pattern visitors 2025-03-18 15:55:47 +11:00
traits Fold visit into ty 2025-03-15 06:34:36 +00:00
ty Rollup merge of #130883 - madsmtm:env-var-query, r=petrochenkov 2025-03-27 15:57:21 +11:00
util Simplify intra-crate qualifiers. 2025-02-11 14:59:13 +11:00
arena.rs intern valtrees 2025-02-13 00:38:17 +01:00
error.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
lib.rs Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
lint.rs Move methods from Map to TyCtxt, part 3. 2025-02-21 14:31:09 +11:00
macros.rs Fold visit into ty 2025-03-15 06:34:36 +00:00
metadata.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs match lowering cleanup: non_scalar_compare is only for &str 2025-03-21 20:14:40 -07:00
values.rs Avoiding calling queries when collecting active queries 2025-03-26 09:36:36 +01:00