We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f7e364 commit ca5ed4cCopy full SHA for ca5ed4c
src/libstd/ops.rs
@@ -81,3 +81,28 @@ pub trait Shr<RHS,Result> {
81
pub trait Index<Index,Result> {
82
fn index(&self, index: &Index) -> Result;
83
}
84
+
85
+#[cfg(test)]
86
+mod bench {
87
88
+ use extra::test::BenchHarness;
89
+ use ops::Drop;
90
91
+ // Overhead of dtors
92
93
+ struct HasDtor {
94
+ x: int
95
+ }
96
97
+ impl Drop for HasDtor {
98
+ fn drop(&self) {
99
100
101
102
+ #[bench]
103
+ fn alloc_obj_with_dtor(bh: &mut BenchHarness) {
104
+ do bh.iter {
105
+ HasDtor { x : 10 };
106
107
108
+}
0 commit comments