rust/tests/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.rs
2023-01-11 09:32:08 +00:00

14 lines
261 B
Rust

// edition:2021
// Check that precise paths are being reported back in the error message.
fn main() {
let mut x = (5, 0);
let hello = || {
x.0 += 1;
};
let b = hello;
let c = hello; //~ ERROR use of moved value: `hello` [E0382]
}