summaryrefslogtreecommitdiffstats
path: root/tests/ui/liveness/liveness-move-in-loop.rs
blob: 064be14d6d28cd13cf7177f7e3d48bc88802aa80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {

    let y: Box<isize> = 42.into();
    let mut x: Box<isize>;

    loop {
        println!("{}", y);
        loop {
            loop {
                loop {
                    x = y; //~ ERROR use of moved value
                    x.clone();
                }
            }
        }
    }
}