]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass-valgrind/dst-dtor-4.rs
fix merge conflicts
[rust.git] / src / test / run-pass-valgrind / dst-dtor-4.rs
1 // no-prefer-dynamic
2
3 #![feature(unsized_tuple_coercion)]
4
5 static mut DROP_RAN: isize = 0;
6
7 struct Foo;
8 impl Drop for Foo {
9     fn drop(&mut self) {
10         unsafe { DROP_RAN += 1; }
11     }
12 }
13
14 pub fn main() {
15     {
16         let _x: Box<(i32, [Foo])> = Box::<(i32, [Foo; 3])>::new((42, [Foo, Foo, Foo]));
17     }
18     unsafe {
19         assert_eq!(DROP_RAN, 3);
20     }
21 }