diff options
| author | Jubilee <workingjubilee@gmail.com> | 2025-02-10 00:51:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 00:51:50 -0800 |
| commit | 888b4384763b5dcae5696d83c0d99c09ca657b72 (patch) | |
| tree | 38194b557b749272b2c8b08e4355a04c56d7ba20 | |
| parent | ae732f3f654a5e5fdab6a15dc368dfc4cca2904b (diff) | |
| parent | 717d36abc95e5eef728842ccc0701c564e7a5cf1 (diff) | |
| download | rust-888b4384763b5dcae5696d83c0d99c09ca657b72.tar.gz rust-888b4384763b5dcae5696d83c0d99c09ca657b72.zip | |
Rollup merge of #136228 - hkBst:patch-28, r=Mark-Simulacrum
Simplify Rc::as_ptr docs + typo fix
| -rw-r--r-- | library/alloc/src/rc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 6d82f514aa6..09206c2f8b2 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1462,18 +1462,18 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> { /// Provides a raw pointer to the data. /// /// The counts are not affected in any way and the `Rc` is not consumed. The pointer is valid - /// for as long there are strong counts in the `Rc`. + /// for as long as there are strong counts in the `Rc`. /// /// # Examples /// /// ``` /// use std::rc::Rc; /// - /// let x = Rc::new("hello".to_owned()); + /// let x = Rc::new(0); /// let y = Rc::clone(&x); /// let x_ptr = Rc::as_ptr(&x); /// assert_eq!(x_ptr, Rc::as_ptr(&y)); - /// assert_eq!(unsafe { &*x_ptr }, "hello"); + /// assert_eq!(unsafe { *x_ptr }, 0); /// ``` #[stable(feature = "weak_into_raw", since = "1.45.0")] #[rustc_never_returns_null_ptr] |
