0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-22 10:25:09 +01:00
rust/library/core/benches/ops.rs
Nicholas Nethercote 84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00

21 lines
253 B
Rust

use core::ops::*;
use test::Bencher;
// Overhead of dtors
struct HasDtor {
_x: isize,
}
impl Drop for HasDtor {
fn drop(&mut self) {}
}
#[bench]
fn alloc_obj_with_dtor(b: &mut Bencher) {
b.iter(|| {
HasDtor { _x: 10 };
})
}