about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-01-13 10:18:26 +0000
committerbors <bors@rust-lang.org>2025-01-13 10:18:26 +0000
commit3ff1b6410e87a237559ab76ecd50f180afbe861f (patch)
tree68eb1d0fbe3f19c9d8bc6021ffa1844651fbd40a /compiler/rustc_middle/src/query/mod.rs
parentb4045a404ec7f2010ab0465b6b0b35aa8c752248 (diff)
parent4b81c5beb19fa273fe5690bfc5d531b73e87b542 (diff)
downloadrust-3ff1b6410e87a237559ab76ecd50f180afbe861f.tar.gz
rust-3ff1b6410e87a237559ab76ecd50f180afbe861f.zip
Auto merge of #135167 - mzacho:depth-limit-const-eval-query, r=oli-obk
Depth limit const eval query

Currently the const-eval query doesn't have a recursion limit or timeout, causing the complier to freeze in an infinite loop, see #125718. This PR depth limits the `eval_to_const_value_raw` query (with the [`recursion_limit`](https://doc.rust-lang.org/reference/attributes/limits.html) attribute) and improves the diagnostics for query overflow errors, so spans are reported for other dep kinds than `layout_of` (e.g. `eval_to_const_value_raw`).

fixes #125718
fixes #114192
Diffstat (limited to 'compiler/rustc_middle/src/query/mod.rs')
-rw-r--r--compiler/rustc_middle/src/query/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 7d334847d44..5516770726d 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -1243,6 +1243,7 @@ rustc_queries! {
             "simplifying constant for the type system `{}`",
             key.value.display(tcx)
         }
+        depth_limit
         cache_on_disk_if { true }
     }