about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2024-01-06 16:15:22 -0800
committerManish Goregaokar <manishsmail@gmail.com>2024-01-07 08:56:24 -0800
commit936ceb20f57ebfa4ea2f583ae1d0be488b404895 (patch)
tree8dace933a273ad76dc9e61746a200d59b306ed95
parent00506764408132e80658b1312fdd2b72e919119d (diff)
downloadrust-936ceb20f57ebfa4ea2f583ae1d0be488b404895.tar.gz
rust-936ceb20f57ebfa4ea2f583ae1d0be488b404895.zip
lifetime -> lifespan where relevant. improve docs on as_ref()
-rw-r--r--library/core/src/pin.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs
index e106433b44e..c47f097b8a3 100644
--- a/library/core/src/pin.rs
+++ b/library/core/src/pin.rs
@@ -9,12 +9,12 @@
 //! 2. More generally, remain *valid* at that same memory location
 //!
 //! is called "pinning." We would say that a value which satisfies these guarantees has been
-//! "pinned," in that it has been permanently (until the end of its lifetime) attached to its
+//! "pinned," in that it has been permanently (until the end of its lifespan) attached to its
 //! location in memory, as though pinned to a pinboard. Pinning a value is incredibly useful in
 //! that it provides the necessary guarantees[^guarantees] for [`unsafe`] code to be able to
 //! dereference raw pointers to the pinned value for the duration it is pinned (which,
 //! [as we'll see later][drop-guarantee], is necessarily from the time the value is first pinned
-//! until the end of its lifetime). This concept of "pinning" is necessary to implement safe
+//! until the end of its lifespan). This concept of "pinning" is necessary to implement safe
 //! interfaces on top of things like self-referential types and intrusive data structures which
 //! cannot currently be modeled in fully safe Rust using only borrow-checked
 //! [references][reference].
@@ -126,7 +126,7 @@
 //! [`Pin`] is specifically targeted at allowing the implementation of *safe interfaces* around
 //! types which have some state during which they become "address-sensitive." A value in such an
 //! "address-sensitive" state is *not* okay with being *moved* around at-will. Such a value must
-//! stay *un-moved* and valid during the address-sensitive portion of its lifetime because some
+//! stay *un-moved* and valid during the address-sensitive portion of its lifespan because some
 //! interface is relying on those invariants to be true in order for its implementation to be sound.
 //!
 //! As a motivating example of a type which may become address-sensitive, consider a type which
@@ -535,7 +535,7 @@
 //! but it also implies that,
 //!
 //! 2. The memory location that stores the value must not get invalidated or otherwise repurposed
-//! during the lifetime of the pinned value until its [`drop`] returns or panics
+//! during the lifespan of the pinned value until its [`drop`] returns or panics
 //!
 //! This point is subtle but required for intrusive data structures to be implemented soundly.
 //!
@@ -1505,8 +1505,8 @@ impl<'a, T: ?Sized> Pin<&'a T> {
     /// Note: `Pin` also implements `Deref` to the target, which can be used
     /// to access the inner value. However, `Deref` only provides a reference
     /// that lives for as long as the borrow of the `Pin`, not the lifetime of
-    /// the `Pin` itself. This method allows turning the `Pin` into a reference
-    /// with the same lifetime as the original `Pin`.
+    /// the reference contained in the `Pin`. This method allows turning the `Pin` into a reference
+    /// with the same lifetime as the reference it wraps.
     ///
     /// ["pinning projections"]: self#projections-and-structural-pinning
     #[inline(always)]