summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs
blob: 5c278bff90bb0acafeacd70dd3d5128b1a314111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// edition:2021
// check-pass
#![warn(unused)]

fn main() {
    let t = (String::from("Hello"), String::from("World"));
    let g = (String::from("Mr"), String::from("Goose"));

    let a = || {
        let (_, g2) = g;
        //~^ WARN unused variable: `g2`
        let c = ||  {
            let (_, t2) = t;
            //~^ WARN unused variable: `t2`
        };

        c();
    };

    a();
}