about summary refs log tree commit diff
path: root/tests/ui/generic-const-items/def-site-eval.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-01-28 03:44:03 +0100
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-01-28 04:00:37 +0100
commit0a9ee02d0a3ac8a45ab00b817c801f087a06828e (patch)
tree5ea152a9eacc91deac843b00abd1088a60c6b47d /tests/ui/generic-const-items/def-site-eval.rs
parent01a26c026ddd9f0da0307468b07b003b8759fc4a (diff)
downloadrust-0a9ee02d0a3ac8a45ab00b817c801f087a06828e.tar.gz
rust-0a9ee02d0a3ac8a45ab00b817c801f087a06828e.zip
GCI: Don't try to collect mono items inside overly generic free const items
Diffstat (limited to 'tests/ui/generic-const-items/def-site-eval.rs')
-rw-r--r--tests/ui/generic-const-items/def-site-eval.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/generic-const-items/def-site-eval.rs b/tests/ui/generic-const-items/def-site-eval.rs
new file mode 100644
index 00000000000..3ed7f96aed0
--- /dev/null
+++ b/tests/ui/generic-const-items/def-site-eval.rs
@@ -0,0 +1,16 @@
+//! Test that we only evaluate free const items (their def site to be clear)
+//! whose generics don't require monomorphization.
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+//@ revisions: fail pass
+//@[fail] build-fail (we require monomorphization)
+//@[pass] build-pass (we require monomorphization)
+
+const _<_T>: () = panic!();
+const _<const _N: usize>: () = panic!();
+
+#[cfg(fail)]
+const _<'_a>: () = panic!(); //[fail]~ ERROR evaluation of `_::<'_>` failed
+
+fn main() {}