Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 294d87f

Browse files
committedJul 7, 2024
Remove non-focused memory leak in std doctest for Miri.
1 parent 5515bba commit 294d87f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎std/src/sync/condvar.rs

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ impl WaitTimeoutResult {
3535
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
3636
/// let pair2 = Arc::clone(&pair);
3737
///
38+
/// # let handle =
3839
/// thread::spawn(move || {
3940
/// let (lock, cvar) = &*pair2;
4041
///
@@ -58,6 +59,8 @@ impl WaitTimeoutResult {
5859
/// break
5960
/// }
6061
/// }
62+
/// # // Prevent leaks for Miri.
63+
/// # let _ = handle.join();
6164
/// ```
6265
#[must_use]
6366
#[stable(feature = "wait_timeout", since = "1.5.0")]

0 commit comments

Comments
 (0)
Failed to load comments.