We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 400fabe commit 40cf00aCopy full SHA for 40cf00a
library/std/src/sync/mpmc/mod.rs
@@ -1382,3 +1382,6 @@ impl<T> fmt::Debug for Receiver<T> {
1382
f.pad("Receiver { .. }")
1383
}
1384
1385
+
1386
+#[cfg(test)]
1387
+mod tests;
library/std/src/sync/mpmc/tests.rs
@@ -0,0 +1,13 @@
1
+#[test]
2
+fn waker_current_thread_id() {
3
+ let first = super::waker::current_thread_id();
4
+ let t = crate::thread::spawn(|| {
5
+ let second = super::waker::current_thread_id();
6
+ assert_ne!(first, second);
7
+ assert_eq!(second, super::waker::current_thread_id());
8
+ });
9
10
+ assert_eq!(first, super::waker::current_thread_id());
11
+ t.join().unwrap();
12
13
+}
0 commit comments