From: Chris Morgan Date: Wed, 10 Jun 2015 09:26:10 +0000 (+1000) Subject: Make tests work on beta/stable (benchmarks can’t work). X-Git-Tag: 0.11.1~2 X-Git-Url: https://git.chrismorgan.info/anymap/commitdiff_plain/c1c62050536ff169570e82d4c1ba19247968c139 Make tests work on beta/stable (benchmarks can’t work). --- diff --git a/src/lib.rs b/src/lib.rs index b5ae44a..d856ea6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,10 @@ //! This crate provides the `AnyMap` type, a safe and convenient store for one value of each type. #![cfg_attr(feature = "unstable", feature(core, std_misc))] -#![cfg_attr(test, feature(test))] +#![cfg_attr(all(feature = "unstable", test), feature(test))] #![warn(missing_docs, unused_results)] -#[cfg(test)] +#[cfg(all(feature = "unstable", test))] extern crate test; use std::any::TypeId; @@ -290,6 +290,7 @@ impl<'a, A: ?Sized + UncheckedAnyExt, V: IntoBox> VacantEntry<'a, A, V> { } } +#[cfg(feature = "unstable")] #[bench] fn bench_insertion(b: &mut ::test::Bencher) { b.iter(|| { @@ -300,6 +301,7 @@ fn bench_insertion(b: &mut ::test::Bencher) { }) } +#[cfg(feature = "unstable")] #[bench] fn bench_get_missing(b: &mut ::test::Bencher) { b.iter(|| { @@ -310,6 +312,7 @@ fn bench_get_missing(b: &mut ::test::Bencher) { }) } +#[cfg(feature = "unstable")] #[bench] fn bench_get_present(b: &mut ::test::Bencher) { b.iter(|| {