summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-partial-reinit-3.rs
blob: ca484315ba5d65e87570b0ebe5401441d0bb3ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::mem;

struct Test { f: usize }
impl Drop for Test {
    fn drop(&mut self) {}
}

fn main() {
    let mut x = (Test { f: 2 }, Test { f: 4 });
    mem::drop(x.0);
    x.0.f = 3;
    //~^ ERROR assign of moved value: `x.0`
}