Skip to content

Commit 1ceee61

Browse files
committed
fix typo, remove superflous test
1 parent 8af2a40 commit 1ceee61

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

library/alloc/src/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl<T> Arc<T> {
524524
///
525525
/// The similar expression `Arc::try_unwrap(this).ok()` does not
526526
/// offer such a guarantee. See the last example below and the documentation
527-
/// of `try_unwrap`[`Arc::try_unwrap`].
527+
/// of [`try_unwrap`][`Arc::try_unwrap`].
528528
///
529529
/// # Examples
530530
///

library/alloc/src/sync/tests.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -140,41 +140,6 @@ fn unwrap_or_drop() {
140140
assert_eq!(Arc::unwrap_or_drop(x), Some(5));
141141
}
142142

143-
#[test]
144-
fn unwrap_or_drop_linked_list() {
145-
#[derive(Clone)]
146-
struct LinkedList<T>(Option<Arc<Node<T>>>);
147-
struct Node<T>(T, Option<Arc<Node<T>>>);
148-
149-
impl<T> Drop for LinkedList<T> {
150-
fn drop(&mut self) {
151-
let mut x = self.0.take();
152-
while let Some(arc) = x.take() {
153-
Arc::unwrap_or_drop(arc).map(|node| x = node.1);
154-
}
155-
}
156-
}
157-
158-
impl<T> LinkedList<T> {
159-
fn push(&mut self, x: T) {
160-
self.0 = Some(Arc::new(Node(x, self.0.take())));
161-
}
162-
}
163-
164-
use std::thread;
165-
for _ in 0..25 {
166-
let mut x = LinkedList(None);
167-
for i in 0..100000 {
168-
x.push(i);
169-
}
170-
let y = x.clone();
171-
let t1 = thread::spawn(|| drop(x));
172-
let t2 = thread::spawn(|| drop(y));
173-
t1.join().unwrap();
174-
t2.join().unwrap();
175-
}
176-
}
177-
178143
#[test]
179144
fn into_from_raw() {
180145
let x = Arc::new(box "hello");

0 commit comments

Comments
 (0)