rust/tests/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
399 B
Rust
Raw Normal View History

2021-06-27 01:22:46 -05:00
// edition:2021
// check-pass
2021-02-23 16:55:36 -06:00
#![warn(unused)]
fn main() {
let t = (String::from("Hello"), String::from("World"));
let g = (String::from("Mr"), String::from("Goose"));
2021-02-23 16:55:36 -06:00
let a = || {
let (_, g2) = g;
2021-02-23 16:55:36 -06:00
//~^ WARN unused variable: `g2`
let c = || {
let (_, t2) = t;
2021-02-23 16:55:36 -06:00
//~^ WARN unused variable: `t2`
};
c();
};
a();
}