Chris Morgan
›
Git
›
anymap
› blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
commit
grep
author
committer
pickaxe
?
search:
re
Ungate drain iterator (stable in Rust 1.6.0).
[anymap]
/
src
/
lib.rs
diff --git
a/src/lib.rs
b/src/lib.rs
index 8e83babc6336be0b566c0dc8bf7cdb98f9c2ed3e..6eac7dc625b6c22bb3331ba67bfe574f428abd8b 100644
(file)
--- a/
src/lib.rs
+++ b/
src/lib.rs
@@
-1,10
+1,9
@@
//! This crate provides the `AnyMap` type, a safe and convenient store for one value of each type.
//! This crate provides the `AnyMap` type, a safe and convenient store for one value of each type.
-#![cfg_attr(feature = "nightly", feature(core, std_misc))]
-#![cfg_attr(test, feature(test))]
+#![cfg_attr(all(feature = "unstable", test), feature(test))]
#![warn(missing_docs, unused_results)]
#![warn(missing_docs, unused_results)]
-#[cfg(
test
)]
+#[cfg(
all(feature = "unstable", test)
)]
extern crate test;
use std::any::TypeId;
extern crate test;
use std::any::TypeId;
@@
-290,6
+289,7
@@
impl<'a, A: ?Sized + UncheckedAnyExt, V: IntoBox<A>> VacantEntry<'a, A, V> {
}
}
}
}
+#[cfg(feature = "unstable")]
#[bench]
fn bench_insertion(b: &mut ::test::Bencher) {
b.iter(|| {
#[bench]
fn bench_insertion(b: &mut ::test::Bencher) {
b.iter(|| {
@@
-300,6
+300,7
@@
fn bench_insertion(b: &mut ::test::Bencher) {
})
}
})
}
+#[cfg(feature = "unstable")]
#[bench]
fn bench_get_missing(b: &mut ::test::Bencher) {
b.iter(|| {
#[bench]
fn bench_get_missing(b: &mut ::test::Bencher) {
b.iter(|| {
@@
-310,6
+311,7
@@
fn bench_get_missing(b: &mut ::test::Bencher) {
})
}
})
}
+#[cfg(feature = "unstable")]
#[bench]
fn bench_get_present(b: &mut ::test::Bencher) {
b.iter(|| {
#[bench]
fn bench_get_present(b: &mut ::test::Bencher) {
b.iter(|| {
@@
-427,10
+429,15
@@
mod tests {
fn assert_send<T: Send>() { }
fn assert_sync<T: Sync>() { }
fn assert_clone<T: Clone>() { }
fn assert_send<T: Send>() { }
fn assert_sync<T: Sync>() { }
fn assert_clone<T: Clone>() { }
+ fn assert_debug<T: ::std::fmt::Debug>() { }
assert_send::<Map<Any + Send>>();
assert_send::<Map<Any + Send + Sync>>();
assert_sync::<Map<Any + Sync>>();
assert_sync::<Map<Any + Send + Sync>>();
assert_send::<Map<Any + Send>>();
assert_send::<Map<Any + Send + Sync>>();
assert_sync::<Map<Any + Sync>>();
assert_sync::<Map<Any + Send + Sync>>();
+ assert_debug::<Map<Any>>();
+ assert_debug::<Map<Any + Send>>();
+ assert_debug::<Map<Any + Sync>>();
+ assert_debug::<Map<Any + Send + Sync>>();
assert_send::<Map<CloneAny + Send>>();
assert_send::<Map<CloneAny + Send + Sync>>();
assert_sync::<Map<CloneAny + Sync>>();
assert_send::<Map<CloneAny + Send>>();
assert_send::<Map<CloneAny + Send + Sync>>();
assert_sync::<Map<CloneAny + Sync>>();
@@
-439,5
+446,9
@@
mod tests {
assert_clone::<Map<CloneAny + Send + Sync>>();
assert_clone::<Map<CloneAny + Sync>>();
assert_clone::<Map<CloneAny + Send + Sync>>();
assert_clone::<Map<CloneAny + Send + Sync>>();
assert_clone::<Map<CloneAny + Sync>>();
assert_clone::<Map<CloneAny + Send + Sync>>();
+ assert_debug::<Map<CloneAny>>();
+ assert_debug::<Map<CloneAny + Send>>();
+ assert_debug::<Map<CloneAny + Sync>>();
+ assert_debug::<Map<CloneAny + Send + Sync>>();
}
}
}
}