Skip to content

Commit 08455a6

Browse files
committed
fix oversight in test where try_unwrap was not changed back to unwrap_or_drop
1 parent 838e5ed commit 08455a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

library/alloc/src/sync/tests.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ fn unwrap_or_drop() {
112112
for _ in 0..100
113113
// ^ increase chances of hitting uncommon race conditions
114114
{
115-
use std::sync::Arc;
116115
let x = Arc::new(3);
117116
let y = Arc::clone(&x);
118-
let r_thread = std::thread::spawn(|| Arc::try_unwrap(x).ok());
119-
let s_thread = std::thread::spawn(|| Arc::try_unwrap(y).ok());
117+
let r_thread = std::thread::spawn(|| Arc::unwrap_or_drop(x));
118+
let s_thread = std::thread::spawn(|| Arc::unwrap_or_drop(y));
120119
let r = r_thread.join().expect("r_thread panicked");
121120
let s = s_thread.join().expect("s_thread panicked");
122121
assert!(

0 commit comments

Comments
 (0)