]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.rs
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / closures / 2229_closure_analysis / diagnostics / closure-origin-array-diagnostics.rs
1 // edition:2021
2
3 // Test that array access is not stored as part of closure kind origin
4
5 fn expect_fn<F: Fn()>(_f: F) {}
6
7 fn main() {
8     let s = [format!("s"), format!("s")];
9     let c = || { //~ ERROR expected a closure that implements the `Fn`
10         let [_, _s] = s;
11     };
12     expect_fn(c);
13 }