summaryrefslogtreecommitdiffstats
path: root/src/test/ui/structs-enums/class-dtor.rs
blob: 583a5e24098590e9a6ed7591d7659349e8ea4187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]

// pretty-expanded FIXME #23616

struct cat {
  done : extern "C" fn(usize),
  meows : usize,
}

impl Drop for cat {
    fn drop(&mut self) {
        (self.done)(self.meows);
    }
}

fn cat(done: extern "C" fn(usize)) -> cat {
    cat {
        meows: 0,
        done: done
    }
}

pub fn main() {}