]> git.lizzy.rs Git - rust.git/blob - library/core/benches/ops.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / library / core / 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 #[bench]
15 fn alloc_obj_with_dtor(b: &mut Bencher) {
16     b.iter(|| {
17         HasDtor { _x: 10 };
18     })
19 }