diff options
| author | tamaron <tamaron1203@gmail.com> | 2022-02-02 23:07:02 +0900 |
|---|---|---|
| committer | tamaron <tamaron1203@gmail.com> | 2022-02-02 23:07:02 +0900 |
| commit | 83242897fb356f51762e0e466dfd53186725028a (patch) | |
| tree | 4d4edb633bdb18dfec4e571f3c34e7a2c8df51ec | |
| parent | 1ea4851715893ee3f365a8ef09d47165e9a7864f (diff) | |
| download | rust-83242897fb356f51762e0e466dfd53186725028a.tar.gz rust-83242897fb356f51762e0e466dfd53186725028a.zip | |
add tests
| -rw-r--r-- | library/core/tests/future.rs | 8 | ||||
| -rw-r--r-- | library/core/tests/hash/mod.rs | 8 | ||||
| -rw-r--r-- | library/core/tests/iter/traits/iterator.rs | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/library/core/tests/future.rs b/library/core/tests/future.rs index 0ed8c52c212..74b6f74e401 100644 --- a/library/core/tests/future.rs +++ b/library/core/tests/future.rs @@ -118,3 +118,11 @@ fn block_on(fut: impl Future) { } } } + +// just tests by whether or not this compiles +fn _pending_impl_all_auto_traits<T>() { + use std::panic::{RefUnwindSafe, UnwindSafe}; + fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {} + + all_auto_traits::<std::future::Pending<T>>(); +} diff --git a/library/core/tests/hash/mod.rs b/library/core/tests/hash/mod.rs index 72ccdd4848a..a173e461c60 100644 --- a/library/core/tests/hash/mod.rs +++ b/library/core/tests/hash/mod.rs @@ -146,3 +146,11 @@ fn test_build_hasher_object_safe() { let _: &dyn BuildHasher<Hasher = DefaultHasher> = &RandomState::new(); } + +// just tests by whether or not this compiles +fn _build_hasher_default_impl_all_auto_traits<T>() { + use std::panic::{RefUnwindSafe, UnwindSafe}; + fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {} + + all_auto_traits::<std::hash::BuildHasherDefault<T>>(); +} diff --git a/library/core/tests/iter/traits/iterator.rs b/library/core/tests/iter/traits/iterator.rs index bb4da831412..972d61ba909 100644 --- a/library/core/tests/iter/traits/iterator.rs +++ b/library/core/tests/iter/traits/iterator.rs @@ -496,3 +496,11 @@ fn test_collect() { let b: Vec<isize> = a.iter().cloned().collect(); assert!(a == b); } + +// just tests by whether or not this compiles +fn _empty_impl_all_auto_traits<T>() { + use std::panic::{RefUnwindSafe, UnwindSafe}; + fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {} + + all_auto_traits::<std::iter::Empty<T>>(); +} |
