about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-04-06 12:37:28 +0200
committerRalf Jung <post@ralfj.de>2024-04-07 10:06:06 +0200
commita986c0a100dbee1ac2b13752884fcb41928e38a9 (patch)
treee33fdd1857a5b45fb00a37a134c00b76ddd6d2fe
parent1242093da21cbe940f51e224f0e9dae9c4adcd1e (diff)
downloadrust-a986c0a100dbee1ac2b13752884fcb41928e38a9.tar.gz
rust-a986c0a100dbee1ac2b13752884fcb41928e38a9.zip
make a doctest less slow in Miri
-rw-r--r--library/alloc/src/sync.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index 4dea27221b7..6ae52cc7827 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -1062,7 +1062,9 @@ impl<T, A: Allocator> Arc<T, A> {
     ///
     /// // Create a long list and clone it
     /// let mut x = LinkedList::new();
-    /// for i in 0..100000 {
+    /// let size = 100000;
+    /// # let size = if cfg!(miri) { 100 } else { size };
+    /// for i in 0..size {
     ///     x.push(i); // Adds i to the front of x
     /// }
     /// let y = x.clone();