about summary refs log tree commit diff
path: root/tests/ui/generic-const-items
diff options
context:
space:
mode:
authorMartin Zacho <hi@martinzacho.net>2025-01-06 09:04:22 +0100
committerMartin Zacho <hi@martinzacho.net>2025-01-06 09:43:05 +0100
commit38e10e56198759b37595c48c43441a3cafa390a4 (patch)
tree1b7562710d76deb2052c356ccf375c44f0003a7f /tests/ui/generic-const-items
parent83853ccdc3ac840c26aed112f854a3264f9cb614 (diff)
downloadrust-38e10e56198759b37595c48c43441a3cafa390a4.tar.gz
rust-38e10e56198759b37595c48c43441a3cafa390a4.zip
improve diagnostics for const eval query overflow
Diffstat (limited to 'tests/ui/generic-const-items')
-rw-r--r--tests/ui/generic-const-items/recursive.rs7
-rw-r--r--tests/ui/generic-const-items/recursive.stderr11
2 files changed, 14 insertions, 4 deletions
diff --git a/tests/ui/generic-const-items/recursive.rs b/tests/ui/generic-const-items/recursive.rs
index 8244772168b..94cf98ec64b 100644
--- a/tests/ui/generic-const-items/recursive.rs
+++ b/tests/ui/generic-const-items/recursive.rs
@@ -1,12 +1,11 @@
-// FIXME(generic_const_items): This leads to a stack overflow in the compiler!
-//@ known-bug: unknown
-//@ ignore-test
+//@ build-fail
 
 #![feature(generic_const_items)]
 #![allow(incomplete_features)]
+#![recursion_limit = "15"]
 
 const RECUR<T>: () = RECUR::<(T,)>;
 
 fn main() {
-    let _ = RECUR::<()>;
+    let _ = RECUR::<()>; //~ ERROR: queries overflow the depth limit!
 }
diff --git a/tests/ui/generic-const-items/recursive.stderr b/tests/ui/generic-const-items/recursive.stderr
new file mode 100644
index 00000000000..c9a57937428
--- /dev/null
+++ b/tests/ui/generic-const-items/recursive.stderr
@@ -0,0 +1,11 @@
+error: queries overflow the depth limit!
+  --> $DIR/recursive.rs:10:13
+   |
+LL |     let _ = RECUR::<()>;
+   |             ^^^^^^^^^^^
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "30"]` attribute to your crate (`recursive`)
+   = note: query depth increased by 17 when simplifying constant for the type system `RECUR`
+
+error: aborting due to 1 previous error
+