We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddfe1e8 commit fe2f40aCopy full SHA for fe2f40a
library/core/src/pin.rs
@@ -485,6 +485,13 @@ impl<P: Deref<Target: Unpin>> Pin<P> {
485
///
486
/// Unlike `Pin::new_unchecked`, this method is safe because the pointer
487
/// `P` dereferences to an [`Unpin`] type, which cancels the pinning guarantees.
488
+ ///
489
+ /// # Examples
490
491
+ /// ```
492
+ /// let val: u8 = 5;
493
+ /// let pinned: Pin<&u8> = Pin::new(&val);
494
495
#[inline(always)]
496
#[rustc_const_unstable(feature = "const_pin", issue = "76654")]
497
#[stable(feature = "pin", since = "1.33.0")]
0 commit comments