]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs
Add tests for `#[no_mangle]` in `impl` blocks that looks like generic `impl` blocks...
[rust.git] / src / test / ui / const-generics / integer-literal-generic-arg-in-where-clause.rs
1 // check-pass
2 // revisions: full min
3
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6
7 fn takes_closure_of_array_3<F>(f: F) where F: Fn([i32; 3]) {
8     f([1, 2, 3]);
9 }
10
11 fn takes_closure_of_array_3_apit(f: impl Fn([i32; 3])) {
12     f([1, 2, 3]);
13 }
14
15 fn returns_closure_of_array_3() -> impl Fn([i32; 3]) {
16     |_| {}
17 }
18
19 fn main() {
20     takes_closure_of_array_3(returns_closure_of_array_3());
21     takes_closure_of_array_3_apit(returns_closure_of_array_3());
22 }