]> git.lizzy.rs Git - rust.git/blob - src/libcore/benches/ops.rs
Rollup merge of #57798 - hellow554:master, r=davidtwco
[rust.git] / src / libcore / benches / ops.rs
1 use core::ops::*;
2 use test::Bencher;
3
4 // Overhead of dtors
5
6 struct HasDtor {
7     _x: isize
8 }
9
10 impl Drop for HasDtor {
11     fn drop(&mut self) {
12     }
13 }
14
15 #[bench]
16 fn alloc_obj_with_dtor(b: &mut Bencher) {
17     b.iter(|| {
18         HasDtor { _x : 10 };
19     })
20 }