From a986c0a100dbee1ac2b13752884fcb41928e38a9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 6 Apr 2024 12:37:28 +0200 Subject: [PATCH] make a doctest less slow in Miri --- library/alloc/src/sync.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 Arc { /// /// // 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();