about summary refs log tree commit diff
path: root/src/liballoc/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-16 12:10:59 +0000
committerbors <bors@rust-lang.org>2019-12-16 12:10:59 +0000
commitf0d4b571936d4072ed90ab7750636f68f1443b3e (patch)
tree4fc99aa630f968c89e1baf45b39b30b09b01b59c /src/liballoc/sync
parenta605441e049f0b6d5f7715b94b8ac4662fd7fcf6 (diff)
parent71a9a993fbca86dd5144a9993d4658e360edccb5 (diff)
downloadrust-f0d4b571936d4072ed90ab7750636f68f1443b3e.tar.gz
rust-f0d4b571936d4072ed90ab7750636f68f1443b3e.zip
Auto merge of #67342 - Centril:rollup-fl44n41, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #65778 (Stabilize `std::{rc,sync}::Weak::{weak_count, strong_count}`)
 - #66570 (stabilize Result::map_or)
 - #66735 (Add str::strip_prefix and str::strip_suffix)
 - #66771 (Stabilize the `core::panic` module)
 - #67317 (fix type_name_of_val doc comment)
 - #67324 (Fix repetition in matches/mod.rs)
 - #67325 (cleanup with push_fake_read)

Failed merges:

r? @ghost
Diffstat (limited to 'src/liballoc/sync')
-rw-r--r--src/liballoc/sync/tests.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/liballoc/sync/tests.rs b/src/liballoc/sync/tests.rs
index 9ddba495b7e..8f516129cd0 100644
--- a/src/liballoc/sync/tests.rs
+++ b/src/liballoc/sync/tests.rs
@@ -62,28 +62,28 @@ fn test_arc_get_mut() {
 
 #[test]
 fn weak_counts() {
-    assert_eq!(Weak::weak_count(&Weak::<u64>::new()), None);
+    assert_eq!(Weak::weak_count(&Weak::<u64>::new()), 0);
     assert_eq!(Weak::strong_count(&Weak::<u64>::new()), 0);
 
     let a = Arc::new(0);
     let w = Arc::downgrade(&a);
     assert_eq!(Weak::strong_count(&w), 1);
-    assert_eq!(Weak::weak_count(&w), Some(1));
+    assert_eq!(Weak::weak_count(&w), 1);
     let w2 = w.clone();
     assert_eq!(Weak::strong_count(&w), 1);
-    assert_eq!(Weak::weak_count(&w), Some(2));
+    assert_eq!(Weak::weak_count(&w), 2);
     assert_eq!(Weak::strong_count(&w2), 1);
-    assert_eq!(Weak::weak_count(&w2), Some(2));
+    assert_eq!(Weak::weak_count(&w2), 2);
     drop(w);
     assert_eq!(Weak::strong_count(&w2), 1);
-    assert_eq!(Weak::weak_count(&w2), Some(1));
+    assert_eq!(Weak::weak_count(&w2), 1);
     let a2 = a.clone();
     assert_eq!(Weak::strong_count(&w2), 2);
-    assert_eq!(Weak::weak_count(&w2), Some(1));
+    assert_eq!(Weak::weak_count(&w2), 1);
     drop(a2);
     drop(a);
     assert_eq!(Weak::strong_count(&w2), 0);
-    assert_eq!(Weak::weak_count(&w2), Some(1));
+    assert_eq!(Weak::weak_count(&w2), 0);
     drop(w2);
 }