@@ -1428,6 +1428,8 @@ impl<T: ?Sized> Arc<T> {
14281428 /// // the `Arc` between threads.
14291429 /// let five = Arc::from_raw(ptr);
14301430 /// assert_eq!(2, Arc::strong_count(&five));
1431+ /// # // Prevent leaks for Miri.
1432+ /// # Arc::decrement_strong_count(ptr);
14311433 /// }
14321434 /// ```
14331435 #[ inline]
@@ -1487,6 +1489,8 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
14871489 /// let x = Arc::new("hello".to_owned());
14881490 /// let x_ptr = Arc::into_raw(x);
14891491 /// assert_eq!(unsafe { &*x_ptr }, "hello");
1492+ /// # // Prevent leaks for Miri.
1493+ /// # drop(unsafe { Arc::from_raw(x_ptr) });
14901494 /// ```
14911495 #[ must_use = "losing the pointer will leak memory" ]
14921496 #[ stable( feature = "rc_raw" , since = "1.17.0" ) ]
@@ -1769,6 +1773,8 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
17691773 /// // the `Arc` between threads.
17701774 /// let five = Arc::from_raw_in(ptr, System);
17711775 /// assert_eq!(2, Arc::strong_count(&five));
1776+ /// # // Prevent leaks for Miri.
1777+ /// # Arc::decrement_strong_count_in(ptr, System);
17721778 /// }
17731779 /// ```
17741780 #[ inline]
0 commit comments