rust/src/test/compile-fail/cap-clause-use-after-move.rs

8 lines
176 B
Rust
Raw Normal View History

// error-pattern:Unsatisfied precondition constraint
fn main() {
let x = 5;
let _y = fn~(move x) { };
let _z = x; //< error: Unsatisfied precondition constraint
}