mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
19 lines
190 B
Rust
19 lines
190 B
Rust
fn foo(_x: i32) {
|
|
}
|
|
|
|
pub struct rsrc {
|
|
x: i32,
|
|
}
|
|
|
|
impl Drop for rsrc {
|
|
fn drop(&mut self) {
|
|
foo(self.x);
|
|
}
|
|
}
|
|
|
|
pub fn rsrc(x: i32) -> rsrc {
|
|
rsrc {
|
|
x: x
|
|
}
|
|
}
|