Skip to content

Commit

Permalink
add test for closures in abstract consts
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Sep 21, 2020
1 parent 7a02ebd commit 9a493ce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
@@ -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

0 comments on commit 9a493ce

Please sign in to comment.