Skip to content

Commit

Permalink
util: Adjust doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 26, 2023
1 parent 7c0c300 commit 16eecbf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions portable-atomic-util/src/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ impl<T: ?Sized> Shared<T> {
/// assert_eq!(*five, 5);
/// });
/// }
/// # // Sleep to give MIRI time to catch up.
/// # std::thread::sleep(std::time::Duration::from_secs(1));
/// # if cfg!(miri) { std::thread::sleep(std::time::Duration::from_millis(500)); } // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
/// ```
pub struct Arc<T: ?Sized> {
/// The inner heap allocation.
Expand All @@ -123,12 +122,12 @@ pub struct Arc<T: ?Sized> {
/// let five = Arc::new(5);
/// let weak_five = Arc::downgrade(&five);
///
/// # let t =
/// thread::spawn(move || {
/// let five = weak_five.upgrade().unwrap();
/// assert_eq!(*five, 5);
/// });
/// # // Sleep to give MIRI time to catch up.
/// # std::thread::sleep(std::time::Duration::from_secs(1));
/// # t.join().unwrap(); // join thread to avoid https://github.com/rust-lang/miri/issues/1371
/// ```
pub struct Weak<T: ?Sized> {
/// The inner heap allocation.
Expand Down

0 comments on commit 16eecbf

Please sign in to comment.