rust/src/test/run-pass/issue-2487-a.rs

30 lines
351 B
Rust
Raw Normal View History

2012-08-15 20:46:55 -05:00
struct socket {
2012-09-06 21:40:15 -05:00
sock: int,
}
impl socket : Drop {
fn finalize(&self) {}
}
impl socket {
fn set_identity() {
do closure {
setsockopt_bytes(copy self.sock)
}
}
}
2012-09-05 17:58:43 -05:00
fn socket() -> socket {
socket {
sock: 1
}
}
fn closure(f: fn()) { f() }
fn setsockopt_bytes(_sock: int) { }
fn main() {}