summaryrefslogtreecommitdiffstats
path: root/tests/ui/moves/moves-based-on-type-capture-clause-bad.rs
blob: b2f68352f896c78d1ebd4a8523f73961df690123 (plain)
1
2
3
4
5
6
7
8
9
use std::thread;

fn main() {
    let x = "Hello world!".to_string();
    thread::spawn(move|| {
        println!("{}", x);
    });
    println!("{}", x); //~ ERROR borrow of moved value
}