summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.rs
blob: f3be542e40d7a506ea48451e17d4e4bc56c9f46f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// edition:2021

// Test that array access is not stored as part of closure kind origin

fn expect_fn<F: Fn()>(_f: F) {}

fn main() {
    let s = [format!("s"), format!("s")];
    let c = || { //~ ERROR expected a closure that implements the `Fn`
        let [_, _s] = s;
    };
    expect_fn(c);
}