Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Foo;
- impl std::ops::Drop for Foo {
- fn drop(&mut self) {
- println!("drop");
- }
- }
- impl Foo {
- fn as_ptr(&self) -> i32 { 0 }
- }
- fn bar(x: i32) {
- println!("bar");
- }
- fn main() {
- bar(Foo.as_ptr());
- }
Add Comment
Please, Sign In to add comment