Skip to content

Commit

Permalink
Remove non-focused memory leak in std doctest for Miri.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachs18 committed Jul 7, 2024
1 parent 5515bba commit 294d87f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions std/src/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl WaitTimeoutResult {
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = Arc::clone(&pair);
///
/// # let handle =
/// thread::spawn(move || {
/// let (lock, cvar) = &*pair2;
///
Expand All @@ -58,6 +59,8 @@ impl WaitTimeoutResult {
/// break
/// }
/// }
/// # // Prevent leaks for Miri.
/// # let _ = handle.join();
/// ```
#[must_use]
#[stable(feature = "wait_timeout", since = "1.5.0")]
Expand Down

0 comments on commit 294d87f

Please sign in to comment.