diff options
Diffstat (limited to 'src/test/ui/const-generics/late-bound-vars/in_closure.rs')
-rw-r--r-- | src/test/ui/const-generics/late-bound-vars/in_closure.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/late-bound-vars/in_closure.rs b/src/test/ui/const-generics/late-bound-vars/in_closure.rs new file mode 100644 index 000000000..5294cc3b5 --- /dev/null +++ b/src/test/ui/const-generics/late-bound-vars/in_closure.rs @@ -0,0 +1,18 @@ +// run-pass +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +const fn inner<'a>() -> usize where &'a (): Sized { + 3 +} + +fn test<'a>() { + let _ = || { + let _: [u8; inner::<'a>()]; + let _ = [0; inner::<'a>()]; + }; +} + +fn main() { + test(); +} |