]> git.lizzy.rs Git - rust.git/blob - tests/run-pass-valgrind/dst-dtor-4.rs
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / run-pass-valgrind / dst-dtor-4.rs
1 #![feature(unsized_tuple_coercion)]
2
3 static mut DROP_RAN: isize = 0;
4
5 struct Foo;
6 impl Drop for Foo {
7     fn drop(&mut self) {
8         unsafe { DROP_RAN += 1; }
9     }
10 }
11
12 pub fn main() {
13     {
14         let _x: Box<(i32, [Foo])> = Box::<(i32, [Foo; 3])>::new((42, [Foo, Foo, Foo]));
15     }
16     unsafe {
17         assert_eq!(DROP_RAN, 3);
18     }
19 }