Skip to content

Commit 6ca35a6

Browse files
Rollup merge of #38930 - insaneinside:place-left-arrow-syntax-docs, r=brson
Updates to src/libcore/ops.rs docs for RFC#1228 (Placement Left Arrow) Also fixed a minor typo in docs for `core::ops::Place`.
2 parents 1283c02 + af221a2 commit 6ca35a6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libcore/ops.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {}
27762776
#[unstable(feature = "coerce_unsized", issue = "27732")]
27772777
impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
27782778

2779-
/// Both `in (PLACE) EXPR` and `box EXPR` desugar into expressions
2779+
/// Both `PLACE <- EXPR` and `box EXPR` desugar into expressions
27802780
/// that allocate an intermediate "place" that holds uninitialized
27812781
/// state. The desugaring evaluates EXPR, and writes the result at
27822782
/// the address returned by the `pointer` method of this trait.
@@ -2791,7 +2791,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
27912791
/// converting the agent to an instance of the owning pointer, via the
27922792
/// appropriate `finalize` method (see the `InPlace`.
27932793
///
2794-
/// If evaluating EXPR fails, then the destructor for the
2794+
/// If evaluating EXPR fails, then it is up to the destructor for the
27952795
/// implementation of Place to clean up any intermediate state
27962796
/// (e.g. deallocate box storage, pop a stack, etc).
27972797
#[unstable(feature = "placement_new_protocol", issue = "27779")]
@@ -2802,9 +2802,9 @@ pub trait Place<Data: ?Sized> {
28022802
fn pointer(&mut self) -> *mut Data;
28032803
}
28042804

2805-
/// Interface to implementations of `in (PLACE) EXPR`.
2805+
/// Interface to implementations of `PLACE <- EXPR`.
28062806
///
2807-
/// `in (PLACE) EXPR` effectively desugars into:
2807+
/// `PLACE <- EXPR` effectively desugars into:
28082808
///
28092809
/// ```rust,ignore
28102810
/// let p = PLACE;
@@ -2817,7 +2817,7 @@ pub trait Place<Data: ?Sized> {
28172817
/// }
28182818
/// ```
28192819
///
2820-
/// The type of `in (PLACE) EXPR` is derived from the type of `PLACE`;
2820+
/// The type of `PLACE <- EXPR` is derived from the type of `PLACE`;
28212821
/// if the type of `PLACE` is `P`, then the final type of the whole
28222822
/// expression is `P::Place::Owner` (see the `InPlace` and `Boxed`
28232823
/// traits).
@@ -2835,12 +2835,12 @@ pub trait Placer<Data: ?Sized> {
28352835
fn make_place(self) -> Self::Place;
28362836
}
28372837

2838-
/// Specialization of `Place` trait supporting `in (PLACE) EXPR`.
2838+
/// Specialization of `Place` trait supporting `PLACE <- EXPR`.
28392839
#[unstable(feature = "placement_new_protocol", issue = "27779")]
28402840
pub trait InPlace<Data: ?Sized>: Place<Data> {
2841-
/// `Owner` is the type of the end value of `in (PLACE) EXPR`
2841+
/// `Owner` is the type of the end value of `PLACE <- EXPR`
28422842
///
2843-
/// Note that when `in (PLACE) EXPR` is solely used for
2843+
/// Note that when `PLACE <- EXPR` is solely used for
28442844
/// side-effecting an existing data-structure,
28452845
/// e.g. `Vec::emplace_back`, then `Owner` need not carry any
28462846
/// information at all (e.g. it can be the unit type `()` in that

0 commit comments

Comments
 (0)