Skip to content

Commit a986c0a

Browse files
committed
make a doctest less slow in Miri
1 parent 1242093 commit a986c0a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/alloc/src/sync.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,9 @@ impl<T, A: Allocator> Arc<T, A> {
10621062
///
10631063
/// // Create a long list and clone it
10641064
/// let mut x = LinkedList::new();
1065-
/// for i in 0..100000 {
1065+
/// let size = 100000;
1066+
/// # let size = if cfg!(miri) { 100 } else { size };
1067+
/// for i in 0..size {
10661068
/// x.push(i); // Adds i to the front of x
10671069
/// }
10681070
/// let y = x.clone();

0 commit comments

Comments
 (0)