mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
84ac80f192
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
21 lines
253 B
Rust
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 };
|
|
})
|
|
}
|