]> git.proxmox.com Git - rustc.git/blame - src/libcore/benches/ops.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / libcore / benches / ops.rs
CommitLineData
8bb4bdeb
XL
1use core::ops::*;
2use test::Bencher;
7453a54e 3
8bb4bdeb 4// Overhead of dtors
7453a54e 5
8bb4bdeb 6struct HasDtor {
60c5eb7d 7 _x: isize,
85aaf69f 8}
223e47cc 9
8bb4bdeb 10impl Drop for HasDtor {
60c5eb7d 11 fn drop(&mut self) {}
8bb4bdeb
XL
12}
13
14#[bench]
15fn alloc_obj_with_dtor(b: &mut Bencher) {
16 b.iter(|| {
60c5eb7d 17 HasDtor { _x: 10 };
8bb4bdeb 18 })
223e47cc 19}