diff options
Diffstat (limited to 'tests/run-pass-valgrind/cleanup-auto-borrow-obj.rs')
| -rw-r--r-- | tests/run-pass-valgrind/cleanup-auto-borrow-obj.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/run-pass-valgrind/cleanup-auto-borrow-obj.rs b/tests/run-pass-valgrind/cleanup-auto-borrow-obj.rs deleted file mode 100644 index e4ce80b3305..00000000000 --- a/tests/run-pass-valgrind/cleanup-auto-borrow-obj.rs +++ /dev/null @@ -1,28 +0,0 @@ -// This would previously leak the Box<Trait> because we wouldn't -// schedule cleanups when auto borrowing trait objects. -// This program should be valgrind clean. - -static mut DROP_RAN: bool = false; - -struct Foo; -impl Drop for Foo { - fn drop(&mut self) { - unsafe { - DROP_RAN = true; - } - } -} - -trait Trait { - fn dummy(&self) {} -} -impl Trait for Foo {} - -pub fn main() { - { - let _x: &Trait = &*(Box::new(Foo) as Box<Trait>); - } - unsafe { - assert!(DROP_RAN); - } -} |
