File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
src/test/ui/const-generics/const_evaluatable_checked Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
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 ( ) { }
Original file line number Diff line number Diff line change
1
+ error: overly complex generic constant
2
+ --> $DIR/closures.rs:3:35
3
+ |
4
+ LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
5
+ | ^^^^^^^^^^^^^
6
+ |
7
+ note: unsupported rvalue
8
+ --> $DIR/closures.rs:3:39
9
+ |
10
+ LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
11
+ | ^^^^^^^
12
+ = help: consider moving this anonymous constant into a `const` function
13
+
14
+ error: aborting due to previous error
15
+
You can’t perform that action at this time.
0 commit comments