]> git.lizzy.rs Git - rust.git/blob - library/core/benches/any.rs
Merge commit '0cce3f643bfcbb92d5a1bb71858c9cbaff749d6b' into clippyup
[rust.git] / library / core / benches / any.rs
1 use core::any::*;
2 use test::{black_box, Bencher};
3
4 #[bench]
5 fn bench_downcast_ref(b: &mut Bencher) {
6     b.iter(|| {
7         let mut x = 0;
8         let mut y = &mut x as &mut dyn Any;
9         black_box(&mut y);
10         black_box(y.downcast_ref::<isize>() == Some(&0));
11     });
12 }