Skip to content

Commit ca2ef71

Browse files
authoredFeb 4, 2022
Rollup merge of #93585 - tamaroning:add_tests_for_92630, r=m-ou-se
Missing tests for #92630 fixes #93143
2 parents f070e0b + 8324289 commit ca2ef71

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
 

‎library/core/tests/future.rs

+8
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,11 @@ fn block_on(fut: impl Future) {
118118
}
119119
}
120120
}
121+
122+
// just tests by whether or not this compiles
123+
fn _pending_impl_all_auto_traits<T>() {
124+
use std::panic::{RefUnwindSafe, UnwindSafe};
125+
fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {}
126+
127+
all_auto_traits::<std::future::Pending<T>>();
128+
}

‎library/core/tests/hash/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,11 @@ fn test_build_hasher_object_safe() {
146146

147147
let _: &dyn BuildHasher<Hasher = DefaultHasher> = &RandomState::new();
148148
}
149+
150+
// just tests by whether or not this compiles
151+
fn _build_hasher_default_impl_all_auto_traits<T>() {
152+
use std::panic::{RefUnwindSafe, UnwindSafe};
153+
fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {}
154+
155+
all_auto_traits::<std::hash::BuildHasherDefault<T>>();
156+
}

‎library/core/tests/iter/traits/iterator.rs

+8
Original file line numberDiff line numberDiff line change
@@ -496,3 +496,11 @@ fn test_collect() {
496496
let b: Vec<isize> = a.iter().cloned().collect();
497497
assert!(a == b);
498498
}
499+
500+
// just tests by whether or not this compiles
501+
fn _empty_impl_all_auto_traits<T>() {
502+
use std::panic::{RefUnwindSafe, UnwindSafe};
503+
fn all_auto_traits<T: Send + Sync + Unpin + UnwindSafe + RefUnwindSafe>() {}
504+
505+
all_auto_traits::<std::iter::Empty<T>>();
506+
}

0 commit comments

Comments
 (0)