mirror of
https://github.com/rust-lang/rust
synced 2024-10-19 15:03:55 +00:00
Improve documentation.
Co-Authored-By: Mara Bos <m-ou.se@m-ou.se>
This commit is contained in:
parent
5360469b8d
commit
54e443dceb
|
@ -910,8 +910,9 @@ impl<P, U> CoerceUnsized<Pin<U>> for Pin<P> where P: CoerceUnsized<U> {}
|
||||||
#[stable(feature = "pin", since = "1.33.0")]
|
#[stable(feature = "pin", since = "1.33.0")]
|
||||||
impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
|
impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
|
||||||
|
|
||||||
/// Constructs a <code>[Pin]<[&mut] T></code>, by pinning[^1] a `value: T` _locally_[^2]
|
/// Constructs a <code>[Pin]<[&mut] T></code>, by pinning[^1] a `value: T` _locally_[^2].
|
||||||
/// (≠ [in the heap][`Box::pin`]).
|
///
|
||||||
|
/// Unlike [`Box::pin`], this does not involve a heap allocation.
|
||||||
///
|
///
|
||||||
/// [^1]: If the (type `T` of the) given value does not implement [`Unpin`], then this
|
/// [^1]: If the (type `T` of the) given value does not implement [`Unpin`], then this
|
||||||
/// effectively pins the `value` in memory, where it will be unable to be moved.
|
/// effectively pins the `value` in memory, where it will be unable to be moved.
|
||||||
|
@ -1043,8 +1044,7 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
|
||||||
///
|
///
|
||||||
/// <details><summary>Error message</summary>
|
/// <details><summary>Error message</summary>
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```console
|
||||||
/// # const _IGNORE: &str = stringify! {
|
|
||||||
/// error[E0716]: temporary value dropped while borrowed
|
/// error[E0716]: temporary value dropped while borrowed
|
||||||
/// --> src/main.rs:9:28
|
/// --> src/main.rs:9:28
|
||||||
/// |
|
/// |
|
||||||
|
@ -1056,8 +1056,7 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
|
||||||
/// 11 | }; // <- Foo is dropped
|
/// 11 | }; // <- Foo is dropped
|
||||||
/// | - temporary value is freed at the end of this statement
|
/// | - temporary value is freed at the end of this statement
|
||||||
/// |
|
/// |
|
||||||
/// = note: consider using a let binding to create a longer lived value
|
/// = note: consider using a `let` binding to create a longer lived value
|
||||||
/// # };
|
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// </details>
|
/// </details>
|
||||||
|
|
Loading…
Reference in a new issue