rust/src/test/ui/issues/issue-64559.rs
Josh Stone c3f72d1c09 Fix the span used to suggest avoiding for-loop moves
It was using the snippet from the "use" span, which often renders the
same, but with closures that snippet is on the start of the closure
where the value is captured. We should be using the snippet from the
span where it was moved into the `for` loop, which is `move_span`.
2019-09-20 16:06:32 -07:00

7 lines
135 B
Rust

fn main() {
let orig = vec![true];
for _val in orig {}
let _closure = || orig;
//~^ ERROR use of moved value: `orig`
}