rust/tests/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs
2024-02-16 20:02:50 +00:00

22 lines
401 B
Rust

//@ 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();
}