summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-partial-reinit-4.rs
blob: a43a1936678ff7288ec55faa73ce4c00a00a41ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct Test;

struct Test2(Option<Test>);

impl Drop for Test {
    fn drop(&mut self) {
        println!("dropping!");
    }
}

impl Drop for Test2 {
    fn drop(&mut self) {}
}

fn stuff() {
    let mut x : (Test2, Test2);
    (x.0).0 = Some(Test); //~ ERROR E0381
}

fn main() {
    stuff()
}