add test for closures in abstract consts
This commit is contained in:
parent
7a02ebd828
commit
9a493ced74
@ -0,0 +1,6 @@
|
||||
#![feature(const_generics, const_evaluatable_checked)]
|
||||
#![allow(incomplete_features)]
|
||||
fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
|
||||
//~^ ERROR overly complex generic constant
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,15 @@
|
||||
error: overly complex generic constant
|
||||
--> $DIR/closures.rs:3:35
|
||||
|
|
||||
LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
note: unsupported rvalue
|
||||
--> $DIR/closures.rs:3:39
|
||||
|
|
||||
LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
|
||||
| ^^^^^^^
|
||||
= help: consider moving this anonymous constant into a `const` function
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user