We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
available_parallelism()
1 parent 6c6d210 commit 330e8e9Copy full SHA for 330e8e9
library/std/tests/thread.rs
@@ -37,3 +37,21 @@ fn thread_local_containing_const_statements() {
37
assert_eq!(CELL.get(), 1);
38
assert_eq!(REFCELL.take(), 1);
39
}
40
+
41
+#[test]
42
+// Include an ignore list on purpose, so that new platforms don't miss it
43
+#[cfg_attr(
44
+ any(
45
+ target_os = "redox",
46
+ target_os = "l4re",
47
+ target_os = "sgx",
48
+ target_os = "solid_asp3",
49
+ target_os = "teeos",
50
+ target_os = "wasi"
51
+ ),
52
+ should_panic
53
+)]
54
+fn available_parallelism() {
55
+ // check that std::thread::available_parallelism() returns a valid value
56
+ assert!(thread::available_parallelism().is_ok());
57
+}
0 commit comments