We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a02ebd commit 9a493ceCopy full SHA for 9a493ce
src/test/ui/const-generics/const_evaluatable_checked/closures.rs
@@ -0,0 +1,6 @@
1
+#![feature(const_generics, const_evaluatable_checked)]
2
+#![allow(incomplete_features)]
3
+fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
4
+//~^ ERROR overly complex generic constant
5
+
6
+fn main() {}
src/test/ui/const-generics/const_evaluatable_checked/closures.stderr
@@ -0,0 +1,15 @@
+error: overly complex generic constant
+ --> $DIR/closures.rs:3:35
+ |
+LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
+ | ^^^^^^^^^^^^^
7
+note: unsupported rvalue
8
+ --> $DIR/closures.rs:3:39
9
10
11
+ | ^^^^^^^
12
+ = help: consider moving this anonymous constant into a `const` function
13
14
+error: aborting due to previous error
15
0 commit comments